-
- def clean_lt(self):
- lt = self.cleaned_data.get('lt',
- self.initial.get('lt', None))
- if lt is None:
- lt = self.fields['lt'].initial()
- try:
- login_ticket = LoginTicket.objects.get(ticket=lt)
- except LoginTicket.DoesNotExist:
- raise forms.ValidationError("Login ticket expired. Please try again.")
- else:
- login_ticket.delete()