Skip to content

Commit

Permalink
fixed exception retrieving token object from empty session token
Browse files Browse the repository at this point in the history
  • Loading branch information
giohappy committed Feb 4, 2019
1 parent d6d9849 commit 01dcc36
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion geonode/base/oauth.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,9 @@ def get_session_token(session):


def get_token_object_from_session(session):
return AccessToken.objects.get(token=session['access_token'])
if 'access_token' in session:
return AccessToken.objects.get(token=session['access_token'])
return None


def remove_session_token(session):
Expand Down

0 comments on commit 01dcc36

Please sign in to comment.