diff --git a/app/pgp/views.py b/app/pgp/views.py index 3c87a9d1d3cc1493dd09b41200681b5e53e7061e..9184d247682c861566737aaa5622e68076091db1 100644 --- a/app/pgp/views.py +++ b/app/pgp/views.py @@ -44,6 +44,9 @@ class PublicKeyFingerprintDetailView(PermissionRequiredMixin, DetailView): key = queryset.get() except queryset.model.DoesNotExist: raise Http404("No OpenPGP Public Key found %matching the query") + except queryset.model.MultipleObjectsReturned: + # Lookup was with ID, assume the same key matched multple times + return queryset.all()[0] return key class PublicKeyCreateView(PermissionRequiredMixin, CreateView):