Merge pull request 'adaptation bulletins classiques pour etat-civil' (#639) from jmplace/ScoDoc-Lille:fix_bulletin_etat_civil into master
Reviewed-on: https://scodoc.org/git/ScoDoc/ScoDoc/pulls/639
This commit is contained in:
commit
79f833ada7
@ -72,6 +72,7 @@ def format_etud_ident(etud):
|
||||
etud["nom_disp"] = etud["nom"]
|
||||
|
||||
etud["nomprenom"] = format_nomprenom(etud) # M. Pierre DUPONT
|
||||
etud["etat_civil"] = format_etat_civil(etud)
|
||||
if etud["civilite"] == "M":
|
||||
etud["ne"] = ""
|
||||
elif etud["civilite"] == "F":
|
||||
@ -157,6 +158,14 @@ def format_civilite(civilite):
|
||||
raise ScoValueError("valeur invalide pour la civilité: %s" % civilite)
|
||||
|
||||
|
||||
def format_etat_civil(etud: dict):
|
||||
if etud["prenom_etat_civil"]:
|
||||
civ = {"M": "M.", "F": "Mme", "X": ""}[etud["civilite_etat_civil"]]
|
||||
return f'{civ} {etud["prenom_etat_civil"]} {etud["nom"]}'
|
||||
else:
|
||||
return etud["nomprenom"]
|
||||
|
||||
|
||||
def format_lycee(nomlycee):
|
||||
nomlycee = nomlycee.strip()
|
||||
s = nomlycee.lower()
|
||||
|
Loading…
Reference in New Issue
Block a user