+ if ticket_string.startswith('ST'):
+ ticket = ServiceTicket.objects.get(ticket=ticket_string)
+ elif ticket_string.startswith('PT'):
+ ticket = ProxyTicket.objects.get(ticket=ticket_string)
+ else:
+ return _cas2_error_response(INVALID_TICKET,
+ '%(ticket)s is neither Service (ST-...) nor Proxy Ticket (PT-...)' % {
+ 'ticket': ticket_string})