Skip to content
This repository has been archived by the owner on Jul 11, 2019. It is now read-only.

Commit

Permalink
Merge branch 'develop' into feature-thumbnail_badges_#191_hierarchica…
Browse files Browse the repository at this point in the history
…l_badge_#95
  • Loading branch information
Nicolas Dietrich committed Feb 7, 2013
2 parents aada0e4 + afa0273 commit 864aeda
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions adhocracy/lib/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,12 @@ def __call__(self, environ, start_response):
else:
c.active_global_nav = 'home'
c.user = environ.get('repoze.who.identity', {}).get('user')
try:
if c.user and (c.user.banned or c.user.delete_time):
c.user = None
except DetachedInstanceError, e:
log.exception(e)

# make sure we're not using a detached user object
c.user = model.meta.Session.merge(c.user)

if c.user and (c.user.banned or c.user.delete_time):
c.user = None
c.active_controller = request.environ.get('pylons.routes_dict')\
.get('controller')
c.debug = asbool(config.get('debug'))
Expand Down

0 comments on commit 864aeda

Please sign in to comment.