From b7b91fa4152f81d7b401e44709b36af1f348098b Mon Sep 17 00:00:00 2001 From: iziram Date: Fri, 21 Apr 2023 07:22:15 +0200 Subject: [PATCH] bugfix : duplication rouge get_photo_image --- app/api/etudiants.py | 36 ------------------------------------ 1 file changed, 36 deletions(-) diff --git a/app/api/etudiants.py b/app/api/etudiants.py index 462a81ec0..1357d9bdd 100755 --- a/app/api/etudiants.py +++ b/app/api/etudiants.py @@ -170,42 +170,6 @@ def get_photo_image(etudid: int = None, nip: str = None, ine: str = None): return res -@api_web_bp.route("/etudiant/etudid//photo") -@api_web_bp.route("/etudiant/nip//photo") -@api_web_bp.route("/etudiant/ine//photo") -@login_required -@scodoc -@permission_required(Permission.ScoView) -def get_photo_image(etudid: int = None, nip: str = None, ine: str = None): - """ - Retourne la photo de l'étudiant - correspondant ou un placeholder si non existant. - - etudid : l'etudid de l'étudiant - nip : le code nip de l'étudiant - ine : le code ine de l'étudiant - - Attention : Ne peut être qu'utilisée en tant que route de département - """ - - etud = tools.get_etud(etudid, nip, ine) - - if etud is None: - return json_error( - 404, - message="étudiant inconnu", - ) - if not etudid: - filename = sco_photos.UNKNOWN_IMAGE_PATH - - size = request.args.get("size", "orig") - filename = sco_photos.photo_pathname(etud.photo_filename, size=size) - if not filename: - filename = sco_photos.UNKNOWN_IMAGE_PATH - res = sco_photos.build_image_response(filename) - return res - - @bp.route("/etudiants/etudid/", methods=["GET"]) @bp.route("/etudiants/nip/", methods=["GET"]) @bp.route("/etudiants/ine/", methods=["GET"])