From: deyk Date: Wed, 18 Jan 2012 21:52:09 +0000 (-0800) Subject: Added more specific exception handling. This clears up the LoginTicket issue we were... X-Git-Tag: 22.4~56 X-Git-Url: https://git.mdrn.pl/django-cas-provider.git/commitdiff_plain/a92081108f2f9f0f70bd804bd3e87ab16bd02ea7 Added more specific exception handling. This clears up the LoginTicket issue we were having upon successful login. --- diff --git a/cas_provider/forms.py b/cas_provider/forms.py index f40d18c..88d2926 100644 --- a/cas_provider/forms.py +++ b/cas_provider/forms.py @@ -33,7 +33,7 @@ class LoginForm(forms.Form): lt = self.fields['lt'].initial() try: login_ticket = LoginTicket.objects.get(ticket=lt) - except: + except LoginTicket.DoesNotExist: raise forms.ValidationError("Login ticket expired. Please try again.") else: login_ticket.delete()