Skip to content

Commit

Permalink
fix: gender in AddressbookFull
Browse files Browse the repository at this point in the history
  • Loading branch information
francesco-filicetti committed Dec 16, 2024
1 parent e63f387 commit ac057a8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 33 deletions.
45 changes: 12 additions & 33 deletions addressbook/api/v1/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,43 +233,22 @@ def to_dict(query, req_lang="en", full=False):
"ID": query["matricola"],
"Taxpayer_ID": query["cod_fis"],
"Roles": roles,
"OfficeReference": query["Riferimento Ufficio"]
if "Riferimento Ufficio" in PERSON_CONTACTS_TO_TAKE
else [],
"Email": query["Posta Elettronica"]
if "Posta Elettronica" in PERSON_CONTACTS_TO_TAKE
else [],
"PEC": query["POSTA ELETTRONICA CERTIFICATA"]
if "POSTA ELETTRONICA CERTIFICATA" in PERSON_CONTACTS_TO_TAKE
else [],
"TelOffice": query["Telefono Ufficio"]
if "Telefono Ufficio" in PERSON_CONTACTS_TO_TAKE
else [],
"TelCelOffice": query["Telefono Cellulare Ufficio"]
if "Telefono Cellulare Ufficio" in PERSON_CONTACTS_TO_TAKE
else [],
"OfficeReference": query["Riferimento Ufficio"] if "Riferimento Ufficio" in PERSON_CONTACTS_TO_TAKE else [],
"Email": query["Posta Elettronica"] if "Posta Elettronica" in PERSON_CONTACTS_TO_TAKE else [],
"PEC": query["POSTA ELETTRONICA CERTIFICATA"] if "POSTA ELETTRONICA CERTIFICATA" in PERSON_CONTACTS_TO_TAKE else [],
"TelOffice": query["Telefono Ufficio"] if "Telefono Ufficio" in PERSON_CONTACTS_TO_TAKE else [],
"TelCelOffice": query["Telefono Cellulare Ufficio"] if "Telefono Cellulare Ufficio" in PERSON_CONTACTS_TO_TAKE else [],
"Fax": query["Fax"] if "Faxe" in PERSON_CONTACTS_TO_TAKE else [],
"WebSite": query["URL Sito WEB"]
if "URL Sito WEB" in PERSON_CONTACTS_TO_TAKE
else [],
"CV": query["URL Sito WEB Curriculum Vitae"]
if "URL Sito WEB Curriculum Vitae" in PERSON_CONTACTS_TO_TAKE
else [],
"WebSite": query["URL Sito WEB"] if "URL Sito WEB" in PERSON_CONTACTS_TO_TAKE else [],
"CV": query["URL Sito WEB Curriculum Vitae"] if "URL Sito WEB Curriculum Vitae" in PERSON_CONTACTS_TO_TAKE else [],
"Teacher": query["fl_docente"] or query["cop_teacher"],
"PersonFunctions": functions,
"TeacherCVFull": query["cv_full_it"]
if req_lang == "it" or not query["cv_full_eng"]
else query["cv_full_eng"],
"TeacherCVShort": query["cv_short_it"]
if req_lang == "it" or not query["cv_short_eng"]
else query["cv_short_eng"],
"TeacherCVFull": query["cv_full_it"] if req_lang == "it" or not query["cv_full_eng"] else query["cv_full_eng"],
"TeacherCVShort": query["cv_short_it"] if req_lang == "it" or not query["cv_short_eng"] else query["cv_short_eng"],
"ProfileId": query["profilo"],
"ProfileDescription": query["ds_profilo"]
if query["profilo"] in ALLOWED_PROFILE_ID
else None,
"ProfileShortDescription": query["ds_profilo_breve"]
if query["profilo"] in ALLOWED_PROFILE_ID
else None,
"ProfileDescription": query["ds_profilo"] if query["profilo"] in ALLOWED_PROFILE_ID else None,
"ProfileShortDescription": query["ds_profilo_breve"] if query["profilo"] in ALLOWED_PROFILE_ID else None,
"Gender": query["cd_genere"]
}


Expand Down
1 change: 1 addition & 0 deletions addressbook/api/v1/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,7 @@ def getPersonale(personale_id, full=False):
"profilo",
"ds_profilo",
"ds_profilo_breve",
"cd_genere"
)

ruoli = (
Expand Down

0 comments on commit ac057a8

Please sign in to comment.