forked from extern/django-helpdesk
Catch exception when someone enters a non-integer text into the public ticket view form, #576
This commit is contained in:
parent
1d63e25855
commit
03599f462b
@ -43,11 +43,15 @@ def homepage(request):
|
|||||||
return render(request, template_name='helpdesk/public_spam.html')
|
return render(request, template_name='helpdesk/public_spam.html')
|
||||||
else:
|
else:
|
||||||
ticket = form.save()
|
ticket = form.save()
|
||||||
return HttpResponseRedirect('%s?ticket=%s&email=%s' % (
|
try:
|
||||||
reverse('helpdesk:public_view'),
|
return HttpResponseRedirect('%s?ticket=%s&email=%s' % (
|
||||||
ticket.ticket_for_url,
|
reverse('helpdesk:public_view'),
|
||||||
urlquote(ticket.submitter_email))
|
ticket.ticket_for_url,
|
||||||
)
|
urlquote(ticket.submitter_email))
|
||||||
|
)
|
||||||
|
except ValueError:
|
||||||
|
# if someone enters a non-int string for the ticket
|
||||||
|
return HttpResponseRedirect(reverse('helpdesk:home'))
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
queue = Queue.objects.get(slug=request.GET.get('queue', None))
|
queue = Queue.objects.get(slug=request.GET.get('queue', None))
|
||||||
|
Loading…
Reference in New Issue
Block a user