1
0
forked from ScoDoc/ScoDoc

Fix: création module avec parcours

This commit is contained in:
Emmanuel Viennet 2024-07-04 14:55:02 +02:00
parent a92e1ab853
commit e6a165b18a

View File

@ -142,8 +142,10 @@ class Module(models.ScoDocModel):
@classmethod
def create_from_dict(cls, data: dict) -> "Module":
"""Create from given dict, add parcours"""
"""Create from given dict, add parcours.
Flush session."""
module = super().create_from_dict(data)
db.session.flush()
module._set_parcours_from_list(data.get("parcours", []) or [])
return module