changeset 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 fcc676c6bf3b
files rhodecode/lib/middleware/simplegit.py rhodecode/lib/middleware/simplehg.py
diffstat 2 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/rhodecode/lib/middleware/simplegit.py	Thu Sep 29 23:34:47 2011 +0300
+++ b/rhodecode/lib/middleware/simplegit.py	Thu Sep 29 23:57:44 2011 +0300
@@ -72,7 +72,7 @@
 from rhodecode.lib import safe_str
 from rhodecode.lib.auth import authfunc, HasPermissionAnyMiddleware
 from rhodecode.lib.utils import invalidate_cache, check_repo_fast
-from rhodecode.model.user import UserModel
+from rhodecode.model.db import User
 
 from webob.exc import HTTPNotFound, HTTPForbidden, HTTPInternalServerError
 
@@ -262,7 +262,7 @@
         return repo_name
 
     def __get_user(self, username):
-        return UserModel().get_by_username(username, cache=True)
+        return User.by_username(username)
 
     def __get_action(self, environ):
         """Maps git request commands into a pull or push command.
--- a/rhodecode/lib/middleware/simplehg.py	Thu Sep 29 23:34:47 2011 +0300
+++ b/rhodecode/lib/middleware/simplehg.py	Thu Sep 29 23:57:44 2011 +0300
@@ -38,7 +38,7 @@
 from rhodecode.lib.auth import authfunc, HasPermissionAnyMiddleware
 from rhodecode.lib.utils import make_ui, invalidate_cache, \
     check_repo_fast, ui_sections
-from rhodecode.model.user import UserModel
+from rhodecode.model.db import User
 
 from webob.exc import HTTPNotFound, HTTPForbidden, HTTPInternalServerError
 
@@ -228,7 +228,7 @@
         return repo_name
 
     def __get_user(self, username):
-        return UserModel().get_by_username(username, cache=True)
+        return User.by_username(username)
 
     def __get_action(self, environ):
         """