fnp
/
django-cas-provider.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
ee96de1
)
Fixed faulty redirect if user is already logged in. Added some better logging.
author
deyk
<deyk@crossway.org>
Tue, 7 Feb 2012 19:40:31 +0000
(11:40 -0800)
committer
deyk
<deyk@crossway.org>
Tue, 7 Feb 2012 19:40:31 +0000
(11:40 -0800)
cas_provider/views.py
patch
|
blob
|
history
diff --git
a/cas_provider/views.py
b/cas_provider/views.py
index
ea72805
..
2979d1b
100644
(file)
--- a/
cas_provider/views.py
+++ b/
cas_provider/views.py
@@
-35,7
+35,7
@@
def login(request, template_name='cas/login.html', success_redirect='/account/',
else:
url = service + '&ticket=' + ticket.ticket
logging.debug('Redirecting to %s', url)
else:
url = service + '&ticket=' + ticket.ticket
logging.debug('Redirecting to %s', url)
- return HttpResponseRedirect()
+ return HttpResponseRedirect(
url
)
else:
logging.debug('Redirecting to %s', success_redirect)
return HttpResponseRedirect(success_redirect)
else:
logging.debug('Redirecting to %s', success_redirect)
return HttpResponseRedirect(success_redirect)
@@
-136,6
+136,8
@@
def validate(request):
ticket = ServiceTicket.objects.get(ticket=ticket_string)
except ServiceTicket.DoesNotExist:
logger.exception("Tried to validate with an invalid ticket %s for %s", ticket_string, service)
ticket = ServiceTicket.objects.get(ticket=ticket_string)
except ServiceTicket.DoesNotExist:
logger.exception("Tried to validate with an invalid ticket %s for %s", ticket_string, service)
+ except Exception as e:
+ logger.exception('Got an exception: %s', e)
else:
username = ticket.user.username
ticket.delete()
else:
username = ticket.user.username
ticket.delete()
@@
-145,6
+147,7
@@
def validate(request):
logger.info('Validated %s %s', username, "(also %s)" % histories if histories else '')
return HttpResponse("yes\n%s\n%s" % (username, histories))
logger.info('Validated %s %s', username, "(also %s)" % histories if histories else '')
return HttpResponse("yes\n%s\n%s" % (username, histories))
+ logger.info('Validation failed.')
return HttpResponse("no\n\n")
return HttpResponse("no\n\n")