diff --git a/osinaweb/support/__pycache__/views.cpython-310.pyc b/osinaweb/support/__pycache__/views.cpython-310.pyc index 228ae55e..106d5e11 100644 Binary files a/osinaweb/support/__pycache__/views.cpython-310.pyc and b/osinaweb/support/__pycache__/views.cpython-310.pyc differ 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.")