1
0
forked from ScoDoc/ScoDoc

API logos: noms fonctions pour la doc

This commit is contained in:
Emmanuel Viennet 2024-07-17 15:04:51 +02:00
parent 2b22115dd8
commit 7620880b91

View File

@ -49,7 +49,7 @@ from app.scodoc.sco_utils import json_error
@scodoc
@permission_required(Permission.ScoSuperAdmin)
@as_json
def api_get_glob_logos():
def logo_list_globals():
"""Liste tous les logos"""
logos = list_logos()[None]
return list(logos.keys())
@ -58,7 +58,7 @@ def api_get_glob_logos():
@bp.route("/logo/<string:logoname>")
@scodoc
@permission_required(Permission.ScoSuperAdmin)
def api_get_glob_logo(logoname):
def logo_get_global(logoname):
logo = find_logo(logoname=logoname)
if logo is None:
return json_error(404, message="logo not found")
@ -79,7 +79,7 @@ def _core_get_logos(dept_id) -> list:
@scodoc
@permission_required(Permission.ScoSuperAdmin)
@as_json
def api_get_local_logos_by_acronym(departement):
def logo_get_local_by_acronym(departement):
dept_id = Departement.from_acronym(departement).id
return _core_get_logos(dept_id)
@ -88,7 +88,7 @@ def api_get_local_logos_by_acronym(departement):
@scodoc
@permission_required(Permission.ScoSuperAdmin)
@as_json
def api_get_local_logos_by_id(dept_id):
def logo_get_local_by_id(dept_id):
return _core_get_logos(dept_id)
@ -107,7 +107,7 @@ def _core_get_logo(dept_id, logoname) -> Response:
@bp.route("/departement/<string:departement>/logo/<string:logoname>")
@scodoc
@permission_required(Permission.ScoSuperAdmin)
def api_get_local_logo_dept_by_acronym(departement, logoname):
def logo_get_local_dept_by_acronym(departement, logoname):
dept_id = Departement.from_acronym(departement).id
return _core_get_logo(dept_id, logoname)
@ -115,5 +115,5 @@ def api_get_local_logo_dept_by_acronym(departement, logoname):
@bp.route("/departement/id/<int:dept_id>/logo/<string:logoname>")
@scodoc
@permission_required(Permission.ScoSuperAdmin)
def api_get_local_logo_dept_by_id(dept_id, logoname):
def logo_get_local_dept_by_id(dept_id, logoname):
return _core_get_logo(dept_id, logoname)