From dacf7029e270b8d4f11d380b5703db88776e2283 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Tue, 10 Mar 2020 10:15:45 +0100 Subject: [PATCH] doc-publik: update pages even if there's no "more info" section --- doc-publik/update-publik-doc-from-mallard.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/doc-publik/update-publik-doc-from-mallard.py b/doc-publik/update-publik-doc-from-mallard.py index ee6e07c..8088f69 100644 --- a/doc-publik/update-publik-doc-from-mallard.py +++ b/doc-publik/update-publik-doc-from-mallard.py @@ -33,7 +33,9 @@ for cell in TextCell.objects.filter(slug__startswith='mallard-', page__snapshot_ for img in document.find_all('img'): img.attrs['src'] = 'https://doc.entrouvert.org/%s/dev/%s' % (module, img.attrs['src']) + new_content = content.decode() if more_info: - new_content = content.decode().replace(more_info.decode(), '') - cell.text = new_content - cell.save() + new_content = new_content.replace(more_info.decode(), '') + + cell.text = new_content + cell.save()