Allow members of "Admin" Team to wipe version envs (#3791)

* Allow members of "Admin" Team to wipe version envs

* Ignore celery beat files
humitos/resolver/username-regex
Manuel Kaufmann 2018-03-15 12:37:18 -05:00 committed by Anthony
parent d30cc12d71
commit e73b266558
2 changed files with 4 additions and 1 deletions

1
.gitignore vendored
View File

@ -17,6 +17,7 @@ _build
bower_components/
contrib/supervisord.log
contrib/supervisord.pid
celerybeat-schedule.*
deploy/.vagrant
dist/*
local_settings.py

View File

@ -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':