forked from ScoDoc/ScoDoc
API logos: noms fonctions pour la doc
This commit is contained in:
parent
2b22115dd8
commit
7620880b91
@ -49,7 +49,7 @@ from app.scodoc.sco_utils import json_error
|
|||||||
@scodoc
|
@scodoc
|
||||||
@permission_required(Permission.ScoSuperAdmin)
|
@permission_required(Permission.ScoSuperAdmin)
|
||||||
@as_json
|
@as_json
|
||||||
def api_get_glob_logos():
|
def logo_list_globals():
|
||||||
"""Liste tous les logos"""
|
"""Liste tous les logos"""
|
||||||
logos = list_logos()[None]
|
logos = list_logos()[None]
|
||||||
return list(logos.keys())
|
return list(logos.keys())
|
||||||
@ -58,7 +58,7 @@ def api_get_glob_logos():
|
|||||||
@bp.route("/logo/<string:logoname>")
|
@bp.route("/logo/<string:logoname>")
|
||||||
@scodoc
|
@scodoc
|
||||||
@permission_required(Permission.ScoSuperAdmin)
|
@permission_required(Permission.ScoSuperAdmin)
|
||||||
def api_get_glob_logo(logoname):
|
def logo_get_global(logoname):
|
||||||
logo = find_logo(logoname=logoname)
|
logo = find_logo(logoname=logoname)
|
||||||
if logo is None:
|
if logo is None:
|
||||||
return json_error(404, message="logo not found")
|
return json_error(404, message="logo not found")
|
||||||
@ -79,7 +79,7 @@ def _core_get_logos(dept_id) -> list:
|
|||||||
@scodoc
|
@scodoc
|
||||||
@permission_required(Permission.ScoSuperAdmin)
|
@permission_required(Permission.ScoSuperAdmin)
|
||||||
@as_json
|
@as_json
|
||||||
def api_get_local_logos_by_acronym(departement):
|
def logo_get_local_by_acronym(departement):
|
||||||
dept_id = Departement.from_acronym(departement).id
|
dept_id = Departement.from_acronym(departement).id
|
||||||
return _core_get_logos(dept_id)
|
return _core_get_logos(dept_id)
|
||||||
|
|
||||||
@ -88,7 +88,7 @@ def api_get_local_logos_by_acronym(departement):
|
|||||||
@scodoc
|
@scodoc
|
||||||
@permission_required(Permission.ScoSuperAdmin)
|
@permission_required(Permission.ScoSuperAdmin)
|
||||||
@as_json
|
@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)
|
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>")
|
@bp.route("/departement/<string:departement>/logo/<string:logoname>")
|
||||||
@scodoc
|
@scodoc
|
||||||
@permission_required(Permission.ScoSuperAdmin)
|
@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
|
dept_id = Departement.from_acronym(departement).id
|
||||||
return _core_get_logo(dept_id, logoname)
|
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>")
|
@bp.route("/departement/id/<int:dept_id>/logo/<string:logoname>")
|
||||||
@scodoc
|
@scodoc
|
||||||
@permission_required(Permission.ScoSuperAdmin)
|
@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)
|
return _core_get_logo(dept_id, logoname)
|
||||||
|
Loading…
Reference in New Issue
Block a user