From: deyk Date: Fri, 3 Feb 2012 23:00:52 +0000 (-0800) Subject: Made logging of failed validation more explicit. X-Git-Tag: 22.4~47 X-Git-Url: https://git.mdrn.pl/django-cas-provider.git/commitdiff_plain/d49f1c192506e97590f1c253a21f6b6e95228ea5?ds=sidebyside;hp=-c Made logging of failed validation more explicit. --- d49f1c192506e97590f1c253a21f6b6e95228ea5 diff --git a/cas_provider/views.py b/cas_provider/views.py index 108bc38..eed2d64 100644 --- a/cas_provider/views.py +++ b/cas_provider/views.py @@ -135,6 +135,9 @@ def validate(request): if service is not None and ticket_string is not None: try: ticket = ServiceTicket.objects.get(ticket=ticket_string) + except ServiceTicket.DoesNotExist: + logger.exception("Tried to validate with an invalid ticket: %s / %s", ticket_string, service) + else: username = ticket.user.username ticket.delete() @@ -143,9 +146,6 @@ def validate(request): return HttpResponse("yes\n%s\n%s" % (username, histories)) - except Exception as e: - logger.exception("Got an exception!: %s"% e) - return HttpResponse("no\n\n")