diff --git a/helpdesk/templates/helpdesk/delete_ticket.html b/helpdesk/templates/helpdesk/delete_ticket.html index 3b84d198..4cbdfd1d 100644 --- a/helpdesk/templates/helpdesk/delete_ticket.html +++ b/helpdesk/templates/helpdesk/delete_ticket.html @@ -20,6 +20,8 @@

+ {% csrf_token %} + -{% csrf_token %}
+ {% endblock %} diff --git a/helpdesk/templates/helpdesk/include/unassigned.html b/helpdesk/templates/helpdesk/include/unassigned.html index 743d0eb9..2864e183 100644 --- a/helpdesk/templates/helpdesk/include/unassigned.html +++ b/helpdesk/templates/helpdesk/include/unassigned.html @@ -26,7 +26,7 @@ {{ ticket.created|naturaltime }} - + {% empty %} @@ -66,7 +66,7 @@ {{ ticket.created|naturaltime }} - + {% empty %} diff --git a/helpdesk/views/staff.py b/helpdesk/views/staff.py index 6a028ec9..9fa1b869 100644 --- a/helpdesk/views/staff.py +++ b/helpdesk/views/staff.py @@ -227,10 +227,14 @@ def delete_ticket(request, ticket_id): if request.method == 'GET': return render(request, 'helpdesk/delete_ticket.html', { 'ticket': ticket, + 'next': request.GET.get('next', 'home') }) else: ticket.delete() - return HttpResponseRedirect(reverse('helpdesk:home')) + redirect_to = 'helpdesk:home' + if request.POST.get('next') == 'dashboard': + redirect_to = 'helpdesk:dashboard' + return HttpResponseRedirect(reverse(redirect_to)) delete_ticket = staff_member_required(delete_ticket)