forked from ScoDoc/DocScoDoc
Edition UE BUT: semestre par défaut
This commit is contained in:
parent
2764ff1074
commit
29d295db61
@ -231,13 +231,17 @@ def do_ue_delete(ue_id, delete_validations=False, force=False):
|
||||
return None
|
||||
|
||||
|
||||
def ue_create(formation_id=None):
|
||||
"""Creation d'une UE"""
|
||||
return ue_edit(create=True, formation_id=formation_id)
|
||||
def ue_create(formation_id=None, default_semestre_idx=None):
|
||||
"""Formulaire création d'une UE"""
|
||||
return ue_edit(
|
||||
create=True,
|
||||
formation_id=formation_id,
|
||||
default_semestre_idx=default_semestre_idx,
|
||||
)
|
||||
|
||||
|
||||
def ue_edit(ue_id=None, create=False, formation_id=None):
|
||||
"""Modification ou création d'une UE"""
|
||||
def ue_edit(ue_id=None, create=False, formation_id=None, default_semestre_idx=None):
|
||||
"""Formulaire modification ou création d'une UE"""
|
||||
create = int(create)
|
||||
if not create:
|
||||
U = ue_list(args={"ue_id": ue_id})
|
||||
@ -250,7 +254,7 @@ def ue_edit(ue_id=None, create=False, formation_id=None):
|
||||
submitlabel = "Modifier les valeurs"
|
||||
else:
|
||||
title = "Création d'une UE"
|
||||
initvalues = {}
|
||||
initvalues = {"semestre_idx": default_semestre_idx}
|
||||
submitlabel = "Créer cette UE"
|
||||
formation = Formation.query.get(formation_id)
|
||||
if not formation:
|
||||
|
@ -46,16 +46,17 @@
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endfor %}
|
||||
{% if editable %}
|
||||
<ul>
|
||||
<li class="notes_ue_list notes_ue_list_add"><a class="stdlink" href="{{
|
||||
url_for('notes.ue_create',
|
||||
scodoc_dept=g.scodoc_dept,
|
||||
formation_id=formation.id,
|
||||
default_semestre_idx=semestre_idx,
|
||||
)}}"
|
||||
>ajouter une UE</a>
|
||||
</li>
|
||||
</ul>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
Loading…
Reference in New Issue
Block a user