diff --git a/device/templates/details.html b/device/templates/details.html index a4a95f5..8477948 100644 --- a/device/templates/details.html +++ b/device/templates/details.html @@ -30,7 +30,7 @@ {% trans 'Evidences' %} @@ -53,10 +53,6 @@ {% endif %} -
-
Phid
-
{{ object.id }}
-
Type
{{ object.type }}
diff --git a/device/views.py b/device/views.py index eda5249..90b43e8 100644 --- a/device/views.py +++ b/device/views.py @@ -117,6 +117,10 @@ class PublicDeviceWebView(TemplateView): def get(self, request, *args, **kwargs): self.pk = kwargs['pk'] self.object = Device(id=self.pk) + + if not self.object.last_evidence: + raise Http404 + if self.request.headers.get('Accept') == 'application/json': return self.get_json_response() return super().get(request, *args, **kwargs)