summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDusty Phillips <buchuki@gmail.com>2008-07-30 13:02:44 -0400
committerDusty Phillips <buchuki@gmail.com>2008-07-30 13:02:44 -0400
commitd2abb3637f3011dcc70231bbc552a0e09148506f (patch)
tree5fdcd583c0e65ed240f692e04c1d50a9f80b9407
parent65e45d5f69543e2957ce9a8ecb1dcbd5ff24cc6b (diff)
allow anyone to adopt or disown a package
-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})