convert reverse-URL lookups to helpdesk namespace

in views.staff, this fixes:
-run_report's no-tickets-found redirect to report_index
-del_attachment's redirect to parent ticket view after deletion
This commit is contained in:
Jonathan Barratt 2016-11-11 10:31:37 +07:00
parent 7eceb35d43
commit ebfea8274d
No known key found for this signature in database
GPG Key ID: BCBF01FBE07879DD

View File

@ -1124,7 +1124,7 @@ def run_report(request, report):
if Ticket.objects.all().count() == 0 or report not in ( if Ticket.objects.all().count() == 0 or report not in (
'queuemonth', 'usermonth', 'queuestatus', 'queuepriority', 'userstatus', 'queuemonth', 'usermonth', 'queuestatus', 'queuepriority', 'userstatus',
'userpriority', 'userqueue', 'daysuntilticketclosedbymonth'): 'userpriority', 'userqueue', 'daysuntilticketclosedbymonth'):
return HttpResponseRedirect(reverse("helpdesk_report_index")) return HttpResponseRedirect(reverse("helpdesk:report_index"))
report_queryset = Ticket.objects.all().select_related().filter( report_queryset = Ticket.objects.all().select_related().filter(
queue__in=_get_user_queues(request.user) queue__in=_get_user_queues(request.user)
@ -1475,7 +1475,7 @@ def attachment_del(request, ticket_id, attachment_id):
attachment = get_object_or_404(Attachment, id=attachment_id) attachment = get_object_or_404(Attachment, id=attachment_id)
if request.method == 'POST': if request.method == 'POST':
attachment.delete() attachment.delete()
return HttpResponseRedirect(reverse('helpdesk_view', args=[ticket_id])) return HttpResponseRedirect(reverse('helpdesk:view', args=[ticket_id]))
return render(request, 'helpdesk/ticket_attachment_del.html', { return render(request, 'helpdesk/ticket_attachment_del.html', {
'attachment': attachment, 'attachment': attachment,
'filename': attachment.filename, 'filename': attachment.filename,