From 07f74a87dd77edfff96e18964643eab9bd6ea81d Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Sun, 29 Jan 2012 13:29:33 -0600 Subject: Remove ambiguity in PGPSignature verbose field names Signed-off-by: Dan McGee --- devel/models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/devel/models.py b/devel/models.py index 03a5b15e..a9a2efc5 100644 --- a/devel/models.py +++ b/devel/models.py @@ -24,9 +24,9 @@ def __unicode__(self): class PGPSignature(models.Model): - signer = PGPKeyField(max_length=40, verbose_name="PGP key fingerprint", + signer = PGPKeyField(max_length=40, verbose_name="Signer key fingerprint", help_text="consists of 40 hex digits; use `gpg --fingerprint`") - signee = PGPKeyField(max_length=40, verbose_name="PGP key fingerprint", + signee = PGPKeyField(max_length=40, verbose_name="Signee key fingerprint", help_text="consists of 40 hex digits; use `gpg --fingerprint`") created = models.DateField() expires = models.DateField(null=True, blank=True) -- cgit v1.2.3-54-g00ecf From 1f18484cae88e5553caa5fd593ef31ad458adb25 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Thu, 2 Feb 2012 09:36:29 -0600 Subject: Extract split_package_details() method This is never currently called directly as a view method, but is used by the normal package details view as a fallback if a package cannot be located. This also fixes an issue where looking up a package in a repo it is not in returns the split details page for one package, which is incorrect behavior. Signed-off-by: Dan McGee --- packages/views/__init__.py | 40 +++++++++++++++++++++++----------------- 1 file changed, 23 insertions(+), 17 deletions(-) diff --git a/packages/views/__init__.py b/packages/views/__init__.py index 5be4833e..63942474 100644 --- a/packages/views/__init__.py +++ b/packages/views/__init__.py @@ -103,6 +103,28 @@ def update(request): messages.error(request, "Are you trying to adopt or disown?") return redirect('/packages/') +def split_package_details(request, name='', repo='', arch=''): + arch = get_object_or_404(Arch, name=arch) + arches = [ arch ] + arches.extend(Arch.objects.filter(agnostic=True)) + repo = get_object_or_404(Repo, name__iexact=repo) + pkgs = Package.objects.normal().filter(pkgbase=name, + repo__testing=repo.testing, repo__staging=repo.staging, + arch__in=arches).order_by('pkgname') + if len(pkgs) == 0: + raise Http404 + # we have packages, but ensure at least one is in the given repo + if not any(True for pkg in pkgs if pkg.repo == repo): + raise Http404 + context = { + 'list_title': 'Split Package Details', + 'name': name, + 'arch': arch, + 'packages': pkgs, + } + return direct_to_template(request, 'packages/packages_list.html', + context) + def details(request, name='', repo='', arch=''): if all([name, repo, arch]): try: @@ -112,23 +134,7 @@ def details(request, name='', repo='', arch=''): return direct_to_template(request, 'packages/details.html', {'pkg': pkg, }) except Package.DoesNotExist: - arch = get_object_or_404(Arch, name=arch) - arches = [ arch ] - arches.extend(Arch.objects.filter(agnostic=True)) - repo = get_object_or_404(Repo, name__iexact=repo) - pkgs = Package.objects.normal().filter(pkgbase=name, - repo__testing=repo.testing, repo__staging=repo.staging, - arch__in=arches).order_by('pkgname') - if len(pkgs) == 0: - raise Http404 - context = { - 'list_title': 'Split Package Details', - 'name': name, - 'arch': arch, - 'packages': pkgs, - } - return direct_to_template(request, 'packages/packages_list.html', - context) + return split_package_details(request, name, repo, arch) else: pkg_data = [ ('arch', arch.lower()), -- cgit v1.2.3-54-g00ecf