From d2abb3637f3011dcc70231bbc552a0e09148506f Mon Sep 17 00:00:00 2001 From: Dusty Phillips Date: Wed, 30 Jul 2008 13:02:44 -0400 Subject: allow anyone to adopt or disown a package --- packages/views.py | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'packages') 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}) -- cgit v1.2.3-54-g00ecf