mirror of
https://gitea.mueller.network/extern/django-helpdesk.git
synced 2025-02-23 21:50:55 +01:00
Bugfix: When the submitter clicks 'Accept Resolution' on the public ticket view, the ticket wasn't closed. Fixed with minor changes to both Public & Staff views. Closes ticket #19.
This commit is contained in:
parent
fae7faa236
commit
18ed2a538a
@ -71,6 +71,23 @@ def view_ticket(request):
|
||||
error_message = _('Invalid ticket ID or e-mail address. Please try again.')
|
||||
|
||||
if t:
|
||||
|
||||
if request.GET.has_key('close') and ticket.status == Ticket.RESOLVED_STATUS:
|
||||
from helpdesk.views.staff import update_ticket
|
||||
# Trick the update_ticket() view into thinking it's being called with
|
||||
# a valid POST.
|
||||
request.POST = {
|
||||
'new_status': Ticket.CLOSED_STATUS,
|
||||
'public': 1,
|
||||
'owner': ticket.assigned_to,
|
||||
'title': ticket.title,
|
||||
'comment': _('Submitter accepted resolution and closed ticket'),
|
||||
}
|
||||
request.FILES = {}
|
||||
request.GET = {}
|
||||
|
||||
return update_ticket(request, ticket_id)
|
||||
|
||||
return render_to_response('helpdesk/public_view_ticket.html',
|
||||
RequestContext(request, {
|
||||
'ticket': t,
|
||||
|
@ -148,7 +148,11 @@ def update_ticket(request, ticket_id):
|
||||
if not owner and ticket.assigned_to:
|
||||
owner = ticket.assigned_to.id
|
||||
|
||||
f = FollowUp(ticket=ticket, date=datetime.now(), comment=comment, user=request.user)
|
||||
f = FollowUp(ticket=ticket, date=datetime.now(), comment=comment)
|
||||
|
||||
if request.user.is_staff():
|
||||
f.user = request.user
|
||||
|
||||
f.public = public
|
||||
|
||||
reassigned = False
|
||||
@ -292,7 +296,10 @@ def update_ticket(request, ticket_id):
|
||||
|
||||
ticket.save()
|
||||
|
||||
if request.user.is_staff():
|
||||
return HttpResponseRedirect(ticket.get_absolute_url())
|
||||
else:
|
||||
return HttpResponseRedirect(ticket.ticket_url)
|
||||
update_ticket = staff_member_required(update_ticket)
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user