From 463dfeadd9edbec2b21bcbbeaebb0742fbb652f2 Mon Sep 17 00:00:00 2001 From: jean-marie Place Date: Wed, 18 Aug 2021 19:04:43 +0200 Subject: [PATCH] initialize DeptName pref while creating with flask --- scodoc.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scodoc.py b/scodoc.py index 89cbd5f365..7b5a951ddd 100755 --- a/scodoc.py +++ b/scodoc.py @@ -22,6 +22,7 @@ from app import clear_scodoc_cache from app.auth.models import User, Role, UserRole from app import models +from app.models import ScoPreference from app.views import notes, scolar, absences import tools @@ -170,6 +171,8 @@ def delete_dept(dept): # delete-dept def create_dept(dept): # create-dept "Create new departement" d = models.Departement(acronym=dept) + p1 = ScoPreference(name="DeptName", value=dept, departement=d) + db.session.add(p1) db.session.add(d) db.session.commit() return 0