Merge pull request #35 from maruiz93/master

Issue #31. Solved bug when no attributes.
This commit is contained in:
Cameron Brandon White 2016-01-11 21:17:22 -08:00
commit 5a79b56e0f

View file

@ -122,7 +122,7 @@ def validate(ticket):
current_app.logger.debug("valid")
xml_from_dict = xml_from_dict["cas:serviceResponse"]["cas:authenticationSuccess"]
username = xml_from_dict["cas:user"]
attributes = xml_from_dict["cas:attributes"]
attributes = xml_from_dict.get("cas:attributes", {})
if "cas:memberOf" in attributes:
attributes["cas:memberOf"] = attributes["cas:memberOf"].lstrip('[').rstrip(']').split(',')