From 56e9b2739bfbbc9db92cb23a6bd2029241caf01e Mon Sep 17 00:00:00 2001 From: Ludovic LANGE Date: Sun, 3 Jan 2021 22:53:27 +0100 Subject: [PATCH] [pajemploi] Fix download of monthly report and of record statement --- modules/pajemploi/pages.py | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/modules/pajemploi/pages.py b/modules/pajemploi/pages.py index 8c19757117..00f996c5b3 100644 --- a/modules/pajemploi/pages.py +++ b/modules/pajemploi/pages.py @@ -284,32 +284,28 @@ def iter_documents(self, proto_doc, subscription): yield bs # Relevé mensuel - btn = self.doc.xpath('//input[@id="btRecapEdit"]') - if btn: + frm = self.doc.xpath('//form[@name="formReleveMensuel"]') + if frm: rm = Document() rm.id = "%s_%s" % (proto_doc.id, "rm") rm.date = date rm.format = "pdf" rm.type = DocumentTypes.OTHER rm.label = "Relevé mensuel %s %s" % (subscription.label, date.strftime("%d/%m/%Y")) - rm.url = Regexp( - Attr(".", "onclick", default=""), r"open\('([^\']+)'", default=None - )(btn[0]) + rm.url = Attr(".", "action")(frm[0]) rm._need_refresh_previous_page = True yield rm # Certificat d'Enregistrement - btn = self.doc.xpath('//input[@id="genererPDF"]') - if btn: + frm = self.doc.xpath('//form[@name="formGenererPDF"]') + if frm: ce = Document() ce.id = "%s_%s" % (proto_doc.id, "ce") ce.date = date ce.format = "pdf" ce.type = DocumentTypes.OTHER ce.label = "Certificat d'enregistrement %s %s" % (subscription.label, date.strftime("%d/%m/%Y")) - ce.url = Regexp( - Attr(".", "onclick", default=""), r"open\('([^\']+)'", default=None - )(btn[0]) + ce.url = Attr(".", "action")(frm[0]) ce._need_refresh_previous_page = True yield ce -- GitLab