Mercurial > kallithea
comparison pylons_app/lib/base.py @ 368:e9a6783f5502
fixed user permissions bug when adding permissions to user who couldn load those because of auth decorators
Small fix for hg model and injecting dbrepo into cached repos
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Tue, 27 Jul 2010 14:54:41 +0200 |
parents | 558eb7c5028f |
children | 3171614c0067 |
comparison
equal
deleted
inserted
replaced
367:a26f48ad7a8a | 368:e9a6783f5502 |
---|---|
15 | 15 |
16 def __before__(self): | 16 def __before__(self): |
17 c.hg_app_version = __version__ | 17 c.hg_app_version = __version__ |
18 c.hg_app_name = config['hg_app_name'] | 18 c.hg_app_name = config['hg_app_name'] |
19 c.repo_name = get_repo_slug(request) | 19 c.repo_name = get_repo_slug(request) |
20 c.hg_app_user = auth.get_user(session) | |
21 c.cached_repo_list = _get_repos_cached() | 20 c.cached_repo_list = _get_repos_cached() |
22 self.sa = meta.Session | 21 self.sa = meta.Session |
23 | 22 |
24 def __call__(self, environ, start_response): | 23 def __call__(self, environ, start_response): |
25 """Invoke the Controller""" | 24 """Invoke the Controller""" |
26 # WSGIController.__call__ dispatches to the Controller method | 25 # WSGIController.__call__ dispatches to the Controller method |
27 # the request is routed to. This routing information is | 26 # the request is routed to. This routing information is |
28 # available in environ['pylons.routes_dict'] | 27 # available in environ['pylons.routes_dict'] |
29 try: | 28 try: |
29 #putting this here makes sure that we update permissions every time | |
30 c.hg_app_user = auth.get_user(session) | |
30 return WSGIController.__call__(self, environ, start_response) | 31 return WSGIController.__call__(self, environ, start_response) |
31 finally: | 32 finally: |
32 meta.Session.remove() | 33 meta.Session.remove() |