Asset duplicate tests

Also fixed some random bugs
This commit is contained in:
2020-02-07 19:56:56 +00:00
parent ca553137b6
commit d312634f68
4 changed files with 40 additions and 17 deletions

View File

@@ -1,6 +1,6 @@
from django.contrib.auth.mixins import LoginRequiredMixin
from django.http import JsonResponse
from django.http import HttpResponse
from django.http import HttpResponse, Http404
from django.views import generic
from django.views.decorators.csrf import csrf_exempt
from django.utils.decorators import method_decorator
@@ -87,8 +87,7 @@ class AssetIDUrlMixin:
# Get the single item from the filtered queryset
obj = queryset.get()
except queryset.model.DoesNotExist:
raise Http404(_("No %(verbose_name)s found matching the query") %
{'verbose_name': queryset.model._meta.verbose_name})
raise Http404("No assets found matching the query")
return obj