adapt reporting command to new custom view URLs (#43164)

This commit is contained in:
Frédéric Péters 2020-05-20 17:48:22 +02:00
parent bc05147ced
commit 5a6a0f792a
1 changed files with 2 additions and 2 deletions

View File

@ -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