Skip to content

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

Merged
merged 3 commits into from
Oct 5, 2017
Merged

Conversation

agjohnson
Copy link
Contributor

This adds actions for:

  • Mark project owner as banned
  • Remove project and files on web server

Closes #2762

This adds actions for:

* Mark project owner as banned
* Remove project and files on web server

Closes #2762
@agjohnson agjohnson added the PR: hotfix Pull request applied as hotfix to release label Sep 28, 2017
@agjohnson
Copy link
Contributor Author

Going to hotfix this to web01 to start using on cleanup.

Copy link
Member

@ericholscher ericholscher left a 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?

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)
Copy link
Member

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.

Copy link
Contributor Author

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.


def delete_project(project):
broadcast(type='app', task=tasks.remove_dir, args=[project.doc_path])
project.delete()
Copy link
Member

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.

@agjohnson
Copy link
Contributor Author

Work here avoided touching the Project model because we have larger decisions behind that addition, and they are out of scope for this work.

@agjohnson
Copy link
Contributor Author

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.

@agjohnson agjohnson merged commit 74dbdcd into master Oct 5, 2017
@agjohnson agjohnson deleted the spam-admin-features branch October 5, 2017 02:22
ericholscher pushed a commit that referenced this pull request Oct 9, 2017
* 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: hotfix Pull request applied as hotfix to release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants