Users für FreeDrinkListHistory
Der User wird mit gesenden, wenn man die FreeDrinkListHistory abruft. Dabei wurde die Funktion des Users angepasst, dass nicht ständig, das komplette Gerücht neu initialisiert wird.
This commit is contained in:
parent
1f5eb0be9d
commit
fe7b81a534
|
@ -172,6 +172,7 @@ class Base:
|
|||
data['free_drink_type'] = self.get_free_drink_list_type(data['free_drink_type_id'])
|
||||
data['free_drink_list_reason'] = self.get_free_drink_list_reason(data['free_drink_list_reason_id']) if \
|
||||
data['free_drink_list_reason_id'] else None
|
||||
data['user'] = self.getUserById(data['user_id'], workgroups=False, geruecht=False).toJSON()
|
||||
return retVal
|
||||
except Exception as err:
|
||||
traceback.print_exc()
|
||||
|
|
|
@ -48,7 +48,7 @@ class Base:
|
|||
self.db.connection.rollback()
|
||||
raise DatabaseExecption("Something went worng with Datatabase: {}".format(err))
|
||||
|
||||
def getUserById(self, id, workgroups=True):
|
||||
def getUserById(self, id, workgroups=True, geruecht=True):
|
||||
try:
|
||||
retVal = None
|
||||
cursor = self.db.connection.cursor()
|
||||
|
@ -56,6 +56,7 @@ class Base:
|
|||
data = cursor.fetchone()
|
||||
if data:
|
||||
retVal = User(data)
|
||||
if geruecht:
|
||||
creditLists = self.getCreditListFromUser(retVal)
|
||||
retVal.initGeruechte(creditLists)
|
||||
if workgroups:
|
||||
|
|
Loading…
Reference in New Issue