From d49f1c192506e97590f1c253a21f6b6e95228ea5 Mon Sep 17 00:00:00 2001 From: deyk Date: Fri, 3 Feb 2012 15:00:52 -0800 Subject: [PATCH 1/1] Made logging of failed validation more explicit. --- cas_provider/views.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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") -- 2.20.1