Skip to content

Commit

Permalink
Allow members of "Admin" Team to wipe version envs (#3791)
Browse files Browse the repository at this point in the history
* Allow members of "Admin" Team to wipe version envs

* Ignore celery beat files
  • Loading branch information
humitos authored and agjohnson committed Mar 15, 2018
1 parent d30cc12 commit e73b266
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ _build
bower_components/
contrib/supervisord.log
contrib/supervisord.pid
celerybeat-schedule.*
deploy/.vagrant
dist/*
local_settings.py
Expand Down
4 changes: 3 additions & 1 deletion readthedocs/core/views/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,9 @@ def wipe_version(request, project_slug, version_slug):
project__slug=project_slug,
slug=version_slug,
)
if request.user not in version.project.users.all():
# We need to check by ``for_admin_user`` here to allow members of the
# ``Admin`` team (which doesn't own the project) under the corporate site.
if version.project not in Project.objects.for_admin_user(user=request.user):
raise Http404('You must own this project to wipe it.')

if request.method == 'POST':
Expand Down

0 comments on commit e73b266

Please sign in to comment.