- def clean_lt(self):
- ticket = self.cleaned_data['lt']
- timeframe = datetime.datetime.now() - \
- datetime.timedelta(minutes=settings.CAS_TICKET_EXPIRATION)
- try:
- return LoginTicket.objects.get(ticket=ticket, created__gte=timeframe)
- except LoginTicket.DoesNotExist:
- raise ValidationError(_('Login ticket expired. Please try again.'))
- return ticket
+ def __init__(self, *args, **kwargs):
+ # renew = kwargs.pop('renew', None)
+ # gateway = kwargs.pop('gateway', None)
+ request = kwargs.pop('request', None)
+ super(LoginForm, self).__init__(*args, **kwargs)
+ self.request = request