diff options
| author | Karan Jayachandra <mail@karanjayachandra.com> | 2025-07-25 16:42:46 +0200 |
|---|---|---|
| committer | Karan Jayachandra <mail@karanjayachandra.com> | 2025-07-25 16:42:46 +0200 |
| commit | 90390365bd93a4ee086c2931bb70ffa571a726b9 (patch) | |
| tree | bf1a4f186d9807bb0ba1d9c0a0e3331c06e06623 | |
| parent | 7e480ec648941355c0373197120e81721bc57dd3 (diff) | |
| parent | d274d41970131244e40faecb5b749b4d19b971fe (diff) | |
Merge branch 'develop' into 'main'
Added the court deletion because of duplicate creation
See merge request KaranJayachandra/match_up!20
| -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: |
