Skip to content

Commit

Permalink
Removes reference to old session code [ref #3053]
Browse files Browse the repository at this point in the history
  • Loading branch information
brew committed May 25, 2016
1 parent 08b1b54 commit cf1575e
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions ckan/views/api.py
Expand Up @@ -100,17 +100,14 @@ def _identify_user_default():
g.user = g.user.decode('utf8')
g.userobj = model.User.by_name(g.user)
if g.userobj is None or not g.userobj.is_active():
# This occurs when a user that was still logged in is deleted,
# or when you are logged in, clean db
# and then restart (or when you change your username)
# There is no user object, so even though repoze thinks you
# are logged in and your cookie has ckan_display_name, we
# need to force user to logout and login again to get the
# User object.

# TODO: this should not be done here
# session['lang'] = request.environ.get('CKAN_LANG')
# session.save()

# This occurs when a user that was still logged in is deleted, or
# when you are logged in, clean db and then restart (or when you
# change your username). There is no user object, so even though
# repoze thinks you are logged in and your cookie has
# ckan_display_name, we need to force user to logout and login
# again to get the User object.

ev = request.environ
if 'repoze.who.plugins' in ev:
pth = getattr(ev['repoze.who.plugins']['friendlyform'],
Expand Down

0 comments on commit cf1575e

Please sign in to comment.