From 034df9941aae7c006d3644e47ea6432bbc9f5162 Mon Sep 17 00:00:00 2001 From: Thomas Rusiecki Date: Wed, 26 Feb 2025 23:47:44 -0300 Subject: [PATCH] refactor for new lots urls --- device/templates/new_device.html | 2 +- device/templates/tabs/lots.html | 2 +- device/views.py | 6 +++--- evidence/templates/upload.html | 2 +- login/views.py | 6 +++--- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/device/templates/new_device.html b/device/templates/new_device.html index 46b4ce6..8ba5064 100644 --- a/device/templates/new_device.html +++ b/device/templates/new_device.html @@ -78,7 +78,7 @@ {% endfor %}
- {% translate "Cancel" %} + {% translate "Cancel" %}
diff --git a/device/templates/tabs/lots.html b/device/templates/tabs/lots.html index 59c44ac..be27912 100644 --- a/device/templates/tabs/lots.html +++ b/device/templates/tabs/lots.html @@ -9,7 +9,7 @@ {% if lot.type == tag %}
diff --git a/device/views.py b/device/views.py index b2b3192..fd092d5 100644 --- a/device/views.py +++ b/device/views.py @@ -40,7 +40,7 @@ class NewDeviceView(DashboardView, FormView): template_name = "new_device.html" title = _("New Device") breadcrumb = "Device / New Device" - success_url = reverse_lazy('dashboard:unassigned') + success_url = reverse_lazy('lot:unassigned') form_class = DeviceFormSet def form_valid(self, form): @@ -57,7 +57,7 @@ class EditDeviceView(DashboardView, UpdateView): template_name = "new_device.html" title = _("Update Device") breadcrumb = "Device / Update Device" - success_url = reverse_lazy('dashboard:unassigned_devices') + success_url = reverse_lazy('lot:unassigned_devices') model = SystemProperty def get_form_kwargs(self): @@ -74,7 +74,6 @@ class EditDeviceView(DashboardView, UpdateView): class DetailsView(DashboardView, TemplateView): template_name = "details.html" - title = _("Device") breadcrumb = "Device / Details" model = SystemProperty @@ -113,6 +112,7 @@ class DetailsView(DashboardView, TemplateView): device_notes = Note.objects.filter(snapshot_uuid__in=uuids).order_by('-date') context.update({ 'object': self.object, + 'title': _("Device {}".format(self.object.shortid)), 'snapshot': last_evidence, 'lot_tags': lot_tags, 'dpps': dpps, diff --git a/evidence/templates/upload.html b/evidence/templates/upload.html index e2d7aff..9b61f1c 100644 --- a/evidence/templates/upload.html +++ b/evidence/templates/upload.html @@ -22,7 +22,7 @@ {% bootstrap_form form alert_error_type="none" error_css_class="alert alert-danger alert-icon alert-icon-border" %}
- {% translate "Cancel" %} + {% translate "Cancel" %}
diff --git a/login/views.py b/login/views.py index 885cc86..51bafbf 100644 --- a/login/views.py +++ b/login/views.py @@ -17,17 +17,17 @@ class LoginView(auth_views.LoginView): template_name = 'login.html' extra_context = { 'title': _('Login'), - 'success_url': reverse_lazy('dashboard:unassigned'), + 'success_url': reverse_lazy('lot:unassigned'), 'commit_id': settings.COMMIT, } def get(self, request, *args, **kwargs): self.extra_context['success_url'] = request.GET.get( 'next', - reverse_lazy('dashboard:unassigned') + reverse_lazy('lot:unassigned') ) if not self.request.user.is_anonymous: - return redirect(reverse_lazy('dashboard:unassigned')) + return redirect(reverse_lazy('lot:unassigned')) return super().get(request, *args, **kwargs)