Mercurial > kallithea
comparison rhodecode/lib/middleware/simplegit.py @ 1497:71738535ed78 beta
Removed deprecated usage of UserModel() in simplehg and simplegit
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Thu, 29 Sep 2011 23:57:44 +0300 |
parents | f4fed0b32103 |
children | 7865043e4ca9 |
comparison
equal
deleted
inserted
replaced
1496:f4fed0b32103 | 1497:71738535ed78 |
---|---|
70 from paste.httpheaders import REMOTE_USER, AUTH_TYPE | 70 from paste.httpheaders import REMOTE_USER, AUTH_TYPE |
71 | 71 |
72 from rhodecode.lib import safe_str | 72 from rhodecode.lib import safe_str |
73 from rhodecode.lib.auth import authfunc, HasPermissionAnyMiddleware | 73 from rhodecode.lib.auth import authfunc, HasPermissionAnyMiddleware |
74 from rhodecode.lib.utils import invalidate_cache, check_repo_fast | 74 from rhodecode.lib.utils import invalidate_cache, check_repo_fast |
75 from rhodecode.model.user import UserModel | 75 from rhodecode.model.db import User |
76 | 76 |
77 from webob.exc import HTTPNotFound, HTTPForbidden, HTTPInternalServerError | 77 from webob.exc import HTTPNotFound, HTTPForbidden, HTTPInternalServerError |
78 | 78 |
79 log = logging.getLogger(__name__) | 79 log = logging.getLogger(__name__) |
80 | 80 |
260 raise | 260 raise |
261 repo_name = repo_name.split('/')[0] | 261 repo_name = repo_name.split('/')[0] |
262 return repo_name | 262 return repo_name |
263 | 263 |
264 def __get_user(self, username): | 264 def __get_user(self, username): |
265 return UserModel().get_by_username(username, cache=True) | 265 return User.by_username(username) |
266 | 266 |
267 def __get_action(self, environ): | 267 def __get_action(self, environ): |
268 """Maps git request commands into a pull or push command. | 268 """Maps git request commands into a pull or push command. |
269 | 269 |
270 :param environ: | 270 :param environ: |