From 1c718dffde30f7f0268eefd449e0c50b65a0549e Mon Sep 17 00:00:00 2001 From: viennet Date: Sat, 12 Dec 2020 18:15:29 +0100 Subject: [PATCH] disable photo copying when accessing bulletins --- sco_bulletins_json.py | 4 +++- sco_photos.py | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/sco_bulletins_json.py b/sco_bulletins_json.py index 9420398c..4fdfeb8c 100644 --- a/sco_bulletins_json.py +++ b/sco_bulletins_json.py @@ -122,7 +122,9 @@ def formsemestre_bulletinetud_published_dict( nom=quote_xml_attr(etudinfo["nom"]), prenom=quote_xml_attr(etudinfo["prenom"]), sexe=quote_xml_attr(etudinfo["sexe"]), - photo_url=quote_xml_attr(sco_photos.etud_photo_url(context, etudinfo)), + photo_url=quote_xml_attr( + sco_photos.etud_photo_url(context, etudinfo, fast=True) + ), email=quote_xml_attr(etudinfo["email"]), emailperso=quote_xml_attr(etudinfo["emailperso"]), ) diff --git a/sco_photos.py b/sco_photos.py index 72b8e2e5..12d126df 100644 --- a/sco_photos.py +++ b/sco_photos.py @@ -82,11 +82,13 @@ def photo_portal_url(context, etud): return None -def etud_photo_url(context, etud, size="small", REQUEST=None): +def etud_photo_url(context, etud, size="small", fast=False, REQUEST=None): """url to the image of the student, in "small" size or "orig" size. If ScoDoc doesn't have an image and a portal is configured, link to it. """ photo_url = "get_photo_image?etudid=%s&size=%s" % (etud["etudid"], size) + if fast: + return photo_url path = photo_pathname(context, etud, size=size) if not path: # Portail ?