From e209793aa21320937b9d17d8091b5d3a35c450c8 Mon Sep 17 00:00:00 2001 From: Ross Poulton Date: Tue, 7 Aug 2012 22:50:25 +1000 Subject: [PATCH] When unauthenticated users reach update view, forward to login. Addresses issue #78. --- helpdesk/views/staff.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helpdesk/views/staff.py b/helpdesk/views/staff.py index dcdfaa5f..f02263d4 100644 --- a/helpdesk/views/staff.py +++ b/helpdesk/views/staff.py @@ -243,7 +243,7 @@ view_ticket = staff_member_required(view_ticket) def update_ticket(request, ticket_id, public=False): if not (public or (request.user.is_authenticated() and request.user.is_active and (request.user.is_staff or helpdesk_settings.HELPDESK_ALLOW_NON_STAFF_TICKET_UPDATE))): - return HttpResponseForbidden(_('Sorry, you need to login to do that.')) + return HttpResponseRedirect('%s?next=%s' % (reverse('login'), request.path)) ticket = get_object_or_404(Ticket, id=ticket_id)