From 893acd6a8c67f2c3357c25719d2e71bdaa7095cd Mon Sep 17 00:00:00 2001 From: emile Date: Wed, 3 Jul 2024 13:37:09 +0300 Subject: [PATCH] new --- .../support/__pycache__/views.cpython-310.pyc | Bin 2868 -> 2868 bytes osinaweb/support/views.py | 6 +++--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/osinaweb/support/__pycache__/views.cpython-310.pyc b/osinaweb/support/__pycache__/views.cpython-310.pyc index 228ae55e710da4658ef734c1c9f7655a6133fe4e..106d5e11bf8d48254cbfd2db3fb9dc4735259d27 100644 GIT binary patch delta 431 zcmYk2F-yZh6vyvflFKDcTH9(`i-L<{2OZrUgf0#uIJk*auF^(Z^>P)Fgn|(iv4doD zN>fu^MsFQG0l@&TwDNZr^Fs^p^9&;pJ@42dccBoI;ulnJI} zWo^F(=Ke(o91GNXIJ);7-+O#K3ub|H<9QB}XVH3he#Qd7BBoKCU>+0|(<97`E7?&k z)<*3=U6*=C5N0wf!qk{RW>bg1G8wQf;I2dTfae zHDxKyo8YXLqwr0!K_uCh%4!G=zs-I(>pF diff --git a/osinaweb/support/views.py b/osinaweb/support/views.py index 22fe05ca..afd58c17 100644 --- a/osinaweb/support/views.py +++ b/osinaweb/support/views.py @@ -8,7 +8,9 @@ from django.http import Http404 def ticket_room(request, ticket_number): ticket = get_object_or_404(Ticket, ticket_number=ticket_number) - if hasattr(request.user, 'customerprofile') and request.user.customerprofile == ticket.customer: + if request.user.is_superuser: + base_template = "main.html" + elif hasattr(request.user, 'customerprofile') and request.user.customerprofile == ticket.customer: base_template = "customer_main.html" elif hasattr(request.user, 'staffprofile'): latest_department = TicketDepartment.objects.filter(ticket=ticket).order_by('-date_added').first() @@ -20,8 +22,6 @@ def ticket_room(request, ticket_number): base_template = "main.html" else: raise Http404("You are not authorized to view this ticket.") - elif request.user.is_superuser: - base_template = "main.html" else: raise Http404("You are not authorized to view this ticket.")