This commit is contained in:
Tim Gröger 2020-01-23 23:27:26 +01:00
parent 59a6440c31
commit c76ed6d6da
2 changed files with 8 additions and 3 deletions

View File

@ -4,6 +4,7 @@ from geruecht import db
from geruecht.model.user import User from geruecht.model.user import User
from geruecht.model.creditList import CreditList from geruecht.model.creditList import CreditList
from datetime import datetime, timedelta from datetime import datetime, timedelta
import traceback
class DatabaseController(metaclass=Singleton): class DatabaseController(metaclass=Singleton):
''' '''
@ -144,9 +145,12 @@ class DatabaseController(metaclass=Singleton):
def deleteWorker(self, user, date): def deleteWorker(self, user, date):
cursor = self.db.connection.cursor() try:
cursor.execute("delete from bardienste where user_id={} and startdatetime='{}'".format(user.id, date)) cursor = self.db.connection.cursor()
self.db.connection.commit() 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__': if __name__ == '__main__':
db = DatabaseController() db = DatabaseController()

View File

@ -3,6 +3,7 @@ from datetime import datetime
import geruecht.controller.userController as uc import geruecht.controller.userController as uc
from geruecht.decorator import login_required from geruecht.decorator import login_required
from geruecht.model import MONEY, GASTRO from geruecht.model import MONEY, GASTRO
import time
vorstand = Blueprint("vorstand", __name__) vorstand = Blueprint("vorstand", __name__)
userController = uc.UserController() userController = uc.UserController()