fixed bug, sodass auch ein user sich einloggen kann, wenn er noch nicht in der datenbank ist
This commit is contained in:
parent
c7e1c981e6
commit
ba16743fde
|
@ -9,8 +9,9 @@ from geruecht.model.user import User
|
|||
class Base:
|
||||
def getCreditListFromUser(self, user, **kwargs):
|
||||
try:
|
||||
if user.uid == 'extern':
|
||||
return []
|
||||
if type(user) is User:
|
||||
if user.uid == 'extern':
|
||||
return []
|
||||
cursor = self.db.connection.cursor()
|
||||
if 'year' in kwargs:
|
||||
sql = "select * from creditList where user_id={} and year_date={}".format(user.id if type(user) is User else user, kwargs['year'])
|
||||
|
|
|
@ -38,8 +38,9 @@ class Base:
|
|||
retVal.initGeruechte(creditLists)
|
||||
if workgroups:
|
||||
retVal.workgroups = self.getWorkgroupsOfUser(retVal.id)
|
||||
if retVal.uid == username:
|
||||
return retVal
|
||||
if retVal:
|
||||
if retVal.uid == username:
|
||||
return retVal
|
||||
else:
|
||||
return None
|
||||
except Exception as err:
|
||||
|
|
Loading…
Reference in New Issue