sessions = sessions_result.ok_value()
if not sessions:
logger.error("GetSession failed: {}".format(sessions_result.error()))
- return
+ return None
session = sessions[0]
logger.debug("SESSION : {}".format(session.keys()))
persons = persons_result.ok_value()
if not persons:
logger.error("GetPersons failed: {}".format(persons_result.error()))
- return
+ return None
person = persons[0]
logger.debug("PERSON : {}".format(person))
# user was authenticated at the backend
elif auth_result is not None:
user=auth_result
- if user.is_active:
+ if user is not None and user.is_active:
login(request, user)
if request.user.is_authenticated():