From fbae5d268f55cb1dcba9c332c07dce681415201a Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Sat, 8 Jan 2022 15:27:40 +0100 Subject: [PATCH] =?UTF-8?q?Fix:=20exports=20bul.=20xml=20quand=20non=20pub?= =?UTF-8?q?li=C3=A9s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/but/bulletin_but_xml_compat.py | 4 +++- app/scodoc/sco_bulletins_xml.py | 10 ++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/app/but/bulletin_but_xml_compat.py b/app/but/bulletin_but_xml_compat.py index 10bec3d8..5b4a14ca 100644 --- a/app/but/bulletin_but_xml_compat.py +++ b/app/but/bulletin_but_xml_compat.py @@ -117,7 +117,9 @@ def bulletin_but_xml_compat( ) # Disponible pour publication ? if not published: - return doc # stop ! + return sco_xml.XML_HEADER + ElementTree.tostring(doc).decode( + scu.SCO_ENCODING + ) # stop ! # Moyenne générale: doc.append( Element( diff --git a/app/scodoc/sco_bulletins_xml.py b/app/scodoc/sco_bulletins_xml.py index bf9c63e9..6641c178 100644 --- a/app/scodoc/sco_bulletins_xml.py +++ b/app/scodoc/sco_bulletins_xml.py @@ -93,9 +93,9 @@ def make_xml_formsemestre_bulletinetud( ) if (not sem["bul_hide_xml"]) or force_publishing: - published = "1" + published = 1 else: - published = "0" + published = 0 if xml_nodate: docdate = "" else: @@ -105,7 +105,7 @@ def make_xml_formsemestre_bulletinetud( "etudid": str(etudid), "formsemestre_id": str(formsemestre_id), "date": docdate, - "publie": published, + "publie": str(published), } if sem["etapes"]: el["etape_apo"] = str(sem["etapes"][0]) or "" @@ -141,7 +141,9 @@ def make_xml_formsemestre_bulletinetud( # Disponible pour publication ? if not published: - return doc # stop ! + return sco_xml.XML_HEADER + ElementTree.tostring(doc).decode( + scu.SCO_ENCODING + ) # stop ! # Groupes: partitions = sco_groups.get_partitions_list(formsemestre_id, with_default=False)