-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Add some basic spam removal features to admin #3131
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This adds actions for: * Mark project owner as banned * Remove project and files on web server Closes #2762
Going to hotfix this to web01 to start using on cleanup. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, but I'm -1 on special casing bits in the admin I think?
readthedocs/projects/admin.py
Outdated
if request.POST.get('post'): | ||
for project in queryset: | ||
broadcast(type='app', task=remove_dir, args=[project.doc_path]) | ||
return delete_selected(self, request, queryset) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be good to add a docstring about why we're doing this. To clean up left over stuff from build servers? We could also just call .delete() directly, which should trigger the logic that does this, instead of special casing this one cleanup task.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The admin calls .delete()
on the Project
queryset, bulking the operations, this was to avoid messing with any of the logic there.
Project
also doesn't have a delete method that does this currently, because we need to make a decision on whether a user deleting a project should remove the files from webs.
readthedocs/projects/utils.py
Outdated
|
||
def delete_project(project): | ||
broadcast(type='app', task=tasks.remove_dir, args=[project.doc_path]) | ||
project.delete() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems redundant. Isn't this already called on project.delete()? If not, it should be.
Work here avoided touching the |
Opened up #3145 to address unifying project delete operations. I'll merge this for now and we can make the decision about how to handle projects later. |
* Add some basic spam removal features to admin This adds actions for: * Mark project owner as banned * Remove project and files on web server Closes #2762 * Remove unused attempt at using utils * Add docs on admin removal
This adds actions for:
Closes #2762