diff options
author | Dusty Phillips <buchuki@gmail.com> | 2008-10-07 17:56:27 -0400 |
---|---|---|
committer | Dusty Phillips <buchuki@gmail.com> | 2008-10-07 17:56:50 -0400 |
commit | 26dff01b41af5213ed9c630728592e5e6281c371 (patch) | |
tree | 86fd6c43ffcbab7e1b9c89466e668aebfbaf3c64 /packages | |
parent | ea4f886d6c9fb359ba7a2af2b006952c3420d37e (diff) |
use user messages to communicate status
Diffstat (limited to 'packages')
-rw-r--r-- | packages/views.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/packages/views.py b/packages/views.py index eaef72f6..4491342f 100644 --- a/packages/views.py +++ b/packages/views.py @@ -15,22 +15,22 @@ from archweb_dev.main.models import Arch, Repo, Signoff from archweb_dev.main.utils import make_choice def update(request): + ids = request.POST.getlist('pkgid') if request.POST.has_key('adopt'): mode = 'adopt' - message = 'Adoption was successful' + maint_id = request.user.id if request.POST.has_key('disown'): mode = 'disown' - message = 'Disown was successful' + maint_id = 0 - ids = request.POST.getlist('pkgid') for id in ids: pkg = Package.objects.get(id=id) - if mode == 'adopt': - pkg.maintainer = request.user - elif mode == 'disown': - pkg.maintainer_id = 0 + pkg.maintainer_id = maint_id pkg.save() - return render_response(request, 'status_page.html', {'message':message}) + + request.user.message_set.create(message="%d packages %sed" % ( + len(ids), mode)) + return HttpResponseRedirect('/packages/search/') def details(request, pkgid=0, name='', repo='', arch=''): if pkgid != 0: |