diff options
author | Dan McGee <dan@archlinux.org> | 2010-05-26 09:30:43 -0500 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2010-05-26 09:30:43 -0500 |
commit | 277117ba34204995efac766b715fe62270a5e908 (patch) | |
tree | 2475175f1dcce2c01be09320d5ce1e1977a4ad79 /packages/views.py | |
parent | 8f11dd9065319c5b49fad82c3546d1c291db78fc (diff) |
Move package flagging URLs below the package
We were still using the user-facing package IDs here which we have
eliminated everywhere else Change it to use the same user-friendly URL
pattern we are using elsewhere.
Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'packages/views.py')
-rw-r--r-- | packages/views.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/packages/views.py b/packages/views.py index fc366988..682ddedf 100644 --- a/packages/views.py +++ b/packages/views.py @@ -205,8 +205,9 @@ def files(request, name='', repo='', arch=''): return render_to_response(template, RequestContext(request, {'pkg':pkg,'files':files})) @permission_required('main.change_package') -def unflag(request, pkgid): - pkg = get_object_or_404(Package, id=pkgid) +def unflag(request, name='', repo='', arch=''): + pkg = get_object_or_404(Package, + pkgname=name, repo__name__iexact=repo, arch__name=arch) pkg.needupdate = 0 pkg.save() return HttpResponseRedirect(pkg.get_absolute_url()) @@ -263,8 +264,9 @@ class FlagForm(forms.Form): widget=forms.TextInput(attrs={'style': 'display:none;'}), required=False) -def flag(request, pkgid): - pkg = get_object_or_404(Package, id=pkgid) +def flag(request, name='', repo='', arch=''): + pkg = get_object_or_404(Package, + pkgname=name, repo__name__iexact=repo, arch__name=arch) context = {'pkg': pkg} if pkg.needupdate == 1: # already flagged. do nothing. |