diff options
author | Marcin Kuzminski <marcin@python-works.com> | 2011-03-09 19:47:52 +0100 |
---|---|---|
committer | Marcin Kuzminski <marcin@python-works.com> | 2011-03-09 19:47:52 +0100 |
commit | 7e99f3b00f3cd922e7dff49c0112e6cd6eff6415 (patch) | |
tree | 48b3b003fc2c2bd8a55dd1854aac3a38c3ecec06 /rhodecode/model/user.py | |
parent | e829b01ccb50df9d44f0d88b1c3ac29217d7d6db (diff) |
fixed some bugs in api key auth, added access by api key into rss/atom feeds in global journal
and repositories feeds
--HG--
branch : beta
Diffstat (limited to 'rhodecode/model/user.py')
-rw-r--r-- | rhodecode/model/user.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/rhodecode/model/user.py b/rhodecode/model/user.py index 388f078b..c4994aa5 100644 --- a/rhodecode/model/user.py +++ b/rhodecode/model/user.py @@ -230,7 +230,7 @@ class UserModel(BaseModel): :param user_id: user id to fetch by :param api_key: api key to fetch by """ - if not user_id and not not api_key: + if user_id is None and api_key is None: raise Exception('You need to pass user_id or api_key') try: @@ -239,9 +239,10 @@ class UserModel(BaseModel): else: dbuser = self.get(user_id) - log.debug('filling %s data', dbuser) - for k, v in dbuser.get_dict().items(): - setattr(auth_user, k, v) + if dbuser is not None: + log.debug('filling %s data', dbuser) + for k, v in dbuser.get_dict().items(): + setattr(auth_user, k, v) except: log.error(traceback.format_exc()) |