forked from ScoDoc/ScoDoc
Fix: création module avec parcours
This commit is contained in:
parent
a92e1ab853
commit
e6a165b18a
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user