comparison pylons_app/lib/auth.py @ 194:3d1dd13887f9

invalidate the repo list also for online changes. Small fixes in LoginRequired decorator. Cleaned hgwebdir config.
author Marcin Kuzminski <marcin@python-works.com>
date Sat, 22 May 2010 02:20:26 +0200
parents d8eb7ee27b4c
children da59b7e07e3c
comparison
equal deleted inserted replaced
193:50a39f923f31 194:3d1dd13887f9
81 """ 81 """
82 def __init__(self): 82 def __init__(self):
83 pass 83 pass
84 84
85 def __call__(self, func): 85 def __call__(self, func):
86 log.info('Checking login required') 86 user = session.get('hg_app_user', AuthUser())
87 log.info('Checking login required for %s', user.username)
87 88
88 @wraps(func) 89 @wraps(func)
89 def _wrapper(*fargs, **fkwargs): 90 def _wrapper(*fargs, **fkwargs):
90 user = session.get('hg_app_user', AuthUser())
91 if user.is_authenticated: 91 if user.is_authenticated:
92 log.info('user %s is authenticated', user.username) 92 log.info('user %s is authenticated', user.username)
93 func(*fargs) 93 func(*fargs)
94 else: 94 else:
95 logging.info('user %s not authenticated', user.username) 95 logging.info('user %s not authenticated', user.username)