mirror of
https://github.com/ae-utbm/sith.git
synced 2024-11-26 02:54:20 +00:00
pedagogy: fix import for HUMA on old database
This commit is contained in:
parent
2aa465b138
commit
f0560f0d2a
@ -1581,6 +1581,12 @@ def migrate_pedagogy():
|
|||||||
"AP": "AUTOMN_AND_SPRING",
|
"AP": "AUTOMN_AND_SPRING",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
def department_conversion(department):
|
||||||
|
# Default of this enum is HUMA
|
||||||
|
if not department or department == "Humas":
|
||||||
|
return "HUMA"
|
||||||
|
return department
|
||||||
|
|
||||||
def convert_number(num, default=0):
|
def convert_number(num, default=0):
|
||||||
if not num:
|
if not num:
|
||||||
return default
|
return default
|
||||||
@ -1607,7 +1613,7 @@ def migrate_pedagogy():
|
|||||||
semester=semester_conversion[uv["semestre"]],
|
semester=semester_conversion[uv["semestre"]],
|
||||||
language="FR", # No infos in previous guide about that
|
language="FR", # No infos in previous guide about that
|
||||||
credits=convert_number(uv["guide_credits"]),
|
credits=convert_number(uv["guide_credits"]),
|
||||||
department=convert_text(uv["departement"]),
|
department=department_conversion(uv["departement"]),
|
||||||
title=convert_text(uv["intitule"]),
|
title=convert_text(uv["intitule"]),
|
||||||
manager=convert_text(uv["responsable"]),
|
manager=convert_text(uv["responsable"]),
|
||||||
objectives=convert_text(uv["guide_objectifs"]),
|
objectives=convert_text(uv["guide_objectifs"]),
|
||||||
|
Loading…
Reference in New Issue
Block a user