summaryrefslogtreecommitdiff
path: root/packages/views.py
diff options
context:
space:
mode:
Diffstat (limited to 'packages/views.py')
-rw-r--r--packages/views.py12
1 files changed, 3 insertions, 9 deletions
diff --git a/packages/views.py b/packages/views.py
index d971d7c3..6cadef50 100644
--- a/packages/views.py
+++ b/packages/views.py
@@ -19,19 +19,13 @@ def update(request):
mode = 'disown'
message = 'Disown was successful'
- if request.user.is_authenticated():
- maint = request.user
- else:
- return render_response(request, 'error_page.html', {'errmsg':'No maintainer record found! Are you a maintainer?'})
ids = request.POST.getlist('pkgid')
for id in ids:
pkg = Package.objects.get(id=id)
- if mode == 'adopt' and pkg.maintainer_id == 0:
- pkg.maintainer = maint
- elif mode == 'disown' and pkg.maintainer == maint:
+ if mode == 'adopt':
+ pkg.maintainer = request.user
+ elif mode == 'disown':
pkg.maintainer_id = 0
- else:
- message = "You are not the current maintainer"
pkg.save()
return render_response(request, 'status_page.html', {'message':message})