diff options
Diffstat (limited to 'app/controller.py')
| -rw-r--r-- | app/controller.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/app/controller.py b/app/controller.py index 3bfce38..d5bdbcb 100644 --- a/app/controller.py +++ b/app/controller.py @@ -24,10 +24,9 @@ from app.utilities import ( class Courts: def __init__(self): with app.app_context(): - courts = db.session.query(Court).all() - if len(courts) == 0: - for _ in range(app.config["COURT_COUNT"]): - db.session.add(Court()) + db.session.query(Court).delete() + for _ in range(app.config["COURT_COUNT"]): + db.session.add(Court()) db.session.commit() def get(self, id: int) -> Court: |
