diff --git a/geruecht/controller/databaseController/dbCreditListController.py b/geruecht/controller/databaseController/dbCreditListController.py index 6e75cb7..62a3528 100644 --- a/geruecht/controller/databaseController/dbCreditListController.py +++ b/geruecht/controller/databaseController/dbCreditListController.py @@ -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']) diff --git a/geruecht/controller/databaseController/dbUserController.py b/geruecht/controller/databaseController/dbUserController.py index bc00b16..3e419d4 100644 --- a/geruecht/controller/databaseController/dbUserController.py +++ b/geruecht/controller/databaseController/dbUserController.py @@ -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: