diff --git a/geruecht/controller/databaseController.py b/geruecht/controller/databaseController.py index da45192..321610b 100644 --- a/geruecht/controller/databaseController.py +++ b/geruecht/controller/databaseController.py @@ -4,6 +4,7 @@ from geruecht import db from geruecht.model.user import User from geruecht.model.creditList import CreditList from datetime import datetime, timedelta +import traceback class DatabaseController(metaclass=Singleton): ''' @@ -144,9 +145,12 @@ class DatabaseController(metaclass=Singleton): def deleteWorker(self, user, date): - cursor = self.db.connection.cursor() - cursor.execute("delete from bardienste where user_id={} and startdatetime='{}'".format(user.id, date)) - self.db.connection.commit() + try: + cursor = self.db.connection.cursor() + cursor.execute("delete from bardienste where user_id={} and startdatetime='{}'".format(user.id, date)) + self.db.connection.commit() + except Exception as err: + traceback.print_exc() if __name__ == '__main__': db = DatabaseController() diff --git a/geruecht/vorstand/routes.py b/geruecht/vorstand/routes.py index d1184dc..35e375b 100644 --- a/geruecht/vorstand/routes.py +++ b/geruecht/vorstand/routes.py @@ -3,6 +3,7 @@ from datetime import datetime import geruecht.controller.userController as uc from geruecht.decorator import login_required from geruecht.model import MONEY, GASTRO +import time vorstand = Blueprint("vorstand", __name__) userController = uc.UserController()