mirror of
https://git.v0id.ovh/n3wt-innov/n3wt-school.git
synced 2026-04-05 12:41:27 +00:00
fix: Réintégration du bouton de Bilan de compétence + harmonisation des paths d'upload de fichier
This commit is contained in:
@ -175,13 +175,43 @@ class StudentCompetencyListCreateView(APIView):
|
||||
domaine_dict["categories"].append(categorie_dict)
|
||||
if domaine_dict["categories"]:
|
||||
result.append(domaine_dict)
|
||||
|
||||
establishment = None
|
||||
if student.associated_class and student.associated_class.establishment:
|
||||
establishment = student.associated_class.establishment
|
||||
else:
|
||||
try:
|
||||
establishment = student.registrationform.establishment
|
||||
except Exception:
|
||||
establishment = None
|
||||
|
||||
establishment_logo_path = None
|
||||
if establishment and establishment.logo:
|
||||
try:
|
||||
if establishment.logo.path and os.path.exists(establishment.logo.path):
|
||||
establishment_logo_path = establishment.logo.path
|
||||
except Exception:
|
||||
establishment_logo_path = None
|
||||
|
||||
n3wt_logo_path = os.path.join(settings.BASE_DIR, 'static', 'img', 'logo_min.svg')
|
||||
if not os.path.exists(n3wt_logo_path):
|
||||
n3wt_logo_path = None
|
||||
|
||||
context = {
|
||||
"student": {
|
||||
"first_name": student.first_name,
|
||||
"last_name": student.last_name,
|
||||
"level": student.level,
|
||||
"class_name": student.associated_class.atmosphere_name,
|
||||
"class_name": student.associated_class.atmosphere_name if student.associated_class else "Non assignée",
|
||||
},
|
||||
"establishment": {
|
||||
"name": establishment.name if establishment else "Établissement",
|
||||
"address": establishment.address if establishment else "",
|
||||
"logo_path": establishment_logo_path,
|
||||
},
|
||||
"product": {
|
||||
"name": "n3wt-school",
|
||||
"logo_path": n3wt_logo_path,
|
||||
},
|
||||
"period": period,
|
||||
"date": date.today().strftime("%d/%m/%Y"),
|
||||
|
||||
Reference in New Issue
Block a user