Fix issue #32: Public view for queues with a hyphen in the slug

caused an error. Thanks to simeonf.
This commit is contained in:
Ross Poulton 2008-12-10 09:27:07 +00:00
parent 37c6197859
commit 787a727ecf

View File

@ -60,7 +60,10 @@ def view_ticket(request):
error_message = '' error_message = ''
if ticket and email: if ticket and email:
queue, ticket_id = ticket.split('-') parts = ticket.split('-')
queue = '-'.join(parts[0:-1])
ticket_id = parts[-1]
try: try:
t = Ticket.objects.get(id=ticket_id, queue__slug__iexact=queue, submitter_email__iexact=email) t = Ticket.objects.get(id=ticket_id, queue__slug__iexact=queue, submitter_email__iexact=email)
except Ticket.DoesNotExist: except Ticket.DoesNotExist: