From ca0292aad9009d422c855478a700717572578432 Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Wed, 30 Oct 2024 16:00:23 +0100 Subject: [PATCH] fix some bugs --- device/templates/details.html | 6 +----- device/views.py | 4 ++++ 2 files changed, 5 insertions(+), 5 deletions(-) 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)