diff options
Diffstat (limited to 'packages/views.py')
-rw-r--r-- | packages/views.py | 18 |
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', |