summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrédéric Péters <fpeters@entrouvert.com>2020-05-20 15:48:22 (GMT)
committerFrédéric Péters <fpeters@entrouvert.com>2020-05-20 15:49:05 (GMT)
commit5a6a0f792ab05402fc125448c08279406c81f4df (patch)
treed3899dd7ba8a896accc08d78c5435a2fabe3b957
parentbc05147cedae9514e697bc6cb09a2cb7d751edd0 (diff)
downloadcombo-plugin-gnm-5a6a0f792ab05402fc125448c08279406c81f4df.zip
combo-plugin-gnm-5a6a0f792ab05402fc125448c08279406c81f4df.tar.gz
combo-plugin-gnm-5a6a0f792ab05402fc125448c08279406c81f4df.tar.bz2
adapt reporting command to new custom view URLs (#43164)
-rw-r--r--combo_plugin_gnm/management/commands/gnm_reporting.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/combo_plugin_gnm/management/commands/gnm_reporting.py b/combo_plugin_gnm/management/commands/gnm_reporting.py
index 83818e4..031b353 100644
--- a/combo_plugin_gnm/management/commands/gnm_reporting.py
+++ b/combo_plugin_gnm/management/commands/gnm_reporting.py
@@ -40,9 +40,9 @@ class Command(BaseCommand):
if not reporting_user:
raise CommandError('missing reporting user (%s)' % reporting_user_email)
sheets = []
- for url in re.findall('href="(.*)?"', cell.text):
+ for url in re.findall('href="(.*?)"', cell.text):
url = html.unescape(url)
- url = re.sub(r'/backoffice/management/([a-z0-9/-]+)/\?', r'/api/forms/\1/ods?', url)
+ url = re.sub(r'/backoffice/management/([a-z0-9_-]+)(/[a-z0-9_-]+)?/?(\?)?', r'/api/forms/\1/ods\2\3', url)
resp = requests.get(url, remote_service='auto', user=reporting_user)
if not resp.ok:
continue