Commit ba3337fe authored by sebastien letort's avatar sebastien letort

if a request has no user, get_request_user returns None.

parent 801bc4d9
......@@ -189,6 +189,8 @@ def get_request_user(request):
Returns:
a User or None
"""
if False == hasattr(request, 'user'):
return None
if request.user.is_authenticated:
return request.user
......@@ -201,6 +203,8 @@ def get_request_user(request):
AllgoUser.objects.filter(token=mo.group(1)).first(),
"user", None)
# else ?
def query_webapps_for_user(user):
"""Return a queryset of all webapps visible by a given user"""
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment