diff --git a/geruecht/controller/databaseController/dbFreeDrinkListConfigController.py b/geruecht/controller/databaseController/dbFreeDrinkListConfigController.py index dabb926..1481260 100644 --- a/geruecht/controller/databaseController/dbFreeDrinkListConfigController.py +++ b/geruecht/controller/databaseController/dbFreeDrinkListConfigController.py @@ -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() diff --git a/geruecht/controller/databaseController/dbUserController.py b/geruecht/controller/databaseController/dbUserController.py index 3e419d4..4c1dd1c 100644 --- a/geruecht/controller/databaseController/dbUserController.py +++ b/geruecht/controller/databaseController/dbUserController.py @@ -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,8 +56,9 @@ class Base: data = cursor.fetchone() if data: retVal = User(data) - creditLists = self.getCreditListFromUser(retVal) - retVal.initGeruechte(creditLists) + if geruecht: + creditLists = self.getCreditListFromUser(retVal) + retVal.initGeruechte(creditLists) if workgroups: retVal.workgroups = self.getWorkgroupsOfUser(retVal.id) return retVal