comparison rhodecode/model/user.py @ 686:ff6a8196ebfe beta

fixed anonymous access bug.
author Marcin Kuzminski <marcin@python-works.com>
date Sat, 13 Nov 2010 02:50:32 +0100
parents dd532af216d9
children ecc566f8b69f
comparison
equal deleted inserted replaced
685:87943675813a 686:ff6a8196ebfe
149 """ 149 """
150 Fills user data with those from database and log out user if not 150 Fills user data with those from database and log out user if not
151 present in database 151 present in database
152 :param user: 152 :param user:
153 """ 153 """
154
155 if not hasattr(user, 'user_id') or user.user_id is None:
156 raise Exception('passed in user has to have the user_id attribute')
157
158
154 log.debug('filling auth user data') 159 log.debug('filling auth user data')
155 try: 160 try:
156 dbuser = self.get(user.user_id) 161 dbuser = self.get(user.user_id)
157 user.username = dbuser.username 162 user.username = dbuser.username
158 user.is_admin = dbuser.admin 163 user.is_admin = dbuser.admin