From 85bf169025b66d8db3f658638532e557c45f6e56 Mon Sep 17 00:00:00 2001 From: maccesch Date: Mon, 5 Sep 2011 20:40:53 +0200 Subject: [PATCH] fixed the "take" link when viewing a ticket to create a proper follow up --- helpdesk/views/staff.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/helpdesk/views/staff.py b/helpdesk/views/staff.py index db8f1c45..bc80f60a 100644 --- a/helpdesk/views/staff.py +++ b/helpdesk/views/staff.py @@ -137,8 +137,16 @@ def view_ticket(request, ticket_id): if request.GET.has_key('take'): # Allow the user to assign the ticket to themselves whilst viewing it. - ticket.assigned_to = request.user - ticket.save() + + # Trick the update_ticket() view into thinking it's being called with + # a valid POST. + request.POST = { + 'owner': request.user.id, + 'public': 1, + 'title': ticket.title, + 'comment': '' + } + return update_ticket(request, ticket_id) if request.GET.has_key('close') and ticket.status == Ticket.RESOLVED_STATUS: if not ticket.assigned_to: