summaryrefslogtreecommitdiff
path: root/packages/views.py
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2011-01-20 17:31:37 -0600
committerDan McGee <dan@archlinux.org>2011-01-20 17:31:37 -0600
commit7d043be0b3d090d2f675af5b86856693aa73e787 (patch)
tree01ee8235193e00821c13ed994935c31b019f385a /packages/views.py
parent523a15f81e819379d1d9ae8412ebd8a7c017a512 (diff)
Add an 'unflag all' option
This allows the exact opposite of the 'flag' option as presented to the end user, especially helpful for split packages. The original single unflag package option is also still available. Implements FS#22520. Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'packages/views.py')
-rw-r--r--packages/views.py18
1 files changed, 14 insertions, 4 deletions
diff --git a/packages/views.py b/packages/views.py
index e00e6f94..4f7c3b93 100644
--- a/packages/views.py
+++ b/packages/views.py
@@ -232,7 +232,7 @@ def search(request, page=None):
extra_context=page_dict)
@vary_on_headers('X-Requested-With')
-def files(request, name='', repo='', arch=''):
+def files(request, name, repo, arch):
pkg = get_object_or_404(Package,
pkgname=name, repo__name__iexact=repo, arch__name=arch)
fileslist = PackageFile.objects.filter(pkg=pkg).order_by('path')
@@ -243,7 +243,7 @@ def files(request, name='', repo='', arch=''):
{'pkg':pkg, 'files':fileslist})
@permission_required('main.change_package')
-def unflag(request, name='', repo='', arch=''):
+def unflag(request, name, repo, arch):
pkg = get_object_or_404(Package,
pkgname=name, repo__name__iexact=repo, arch__name=arch)
pkg.flag_date = None
@@ -251,6 +251,16 @@ def unflag(request, name='', repo='', arch=''):
return redirect(pkg)
@permission_required('main.change_package')
+def unflag_all(request, name, repo, arch):
+ pkg = get_object_or_404(Package,
+ pkgname=name, repo__name__iexact=repo, arch__name=arch)
+ # find all packages from (hopefully) the same PKGBUILD
+ pkgs = Package.objects.filter(
+ pkgbase=pkg.pkgbase, repo__testing=pkg.repo.testing)
+ pkgs.update(flag_date=None)
+ return redirect(pkg)
+
+@permission_required('main.change_package')
@never_cache
def signoffs(request):
packages = Package.objects.select_related('arch', 'repo', 'signoffs').filter(repo__testing=True).order_by("pkgname")
@@ -309,7 +319,7 @@ class FlagForm(forms.Form):
required=False)
@never_cache
-def flag(request, name='', repo='', arch=''):
+def flag(request, name, repo, arch):
pkg = get_object_or_404(Package,
pkgname=name, repo__name__iexact=repo, arch__name=arch)
context = {'pkg': pkg}
@@ -361,7 +371,7 @@ def flag(request, name='', repo='', arch=''):
return direct_to_template(request, 'packages/flag.html', context)
-def download(request, name='', repo='', arch=''):
+def download(request, name, repo, arch):
pkg = get_object_or_404(Package,
pkgname=name, repo__name__iexact=repo, arch__name=arch)
mirrorurl = MirrorUrl.objects.filter(mirror__country='Any',