|
|
|
@ -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.")
|
|
|
|
|
|
|
|
|
|