summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrédéric Péters <fpeters@entrouvert.com>2020-03-10 09:15:45 (GMT)
committerFrédéric Péters <fpeters@entrouvert.com>2020-03-10 09:15:45 (GMT)
commitdacf7029e270b8d4f11d380b5703db88776e2283 (patch)
tree60b7d8478fc13b0a008f1b3468ce30baa28d8416
parentbaa110467bd3239c7b268f7f4e7657feb869d30a (diff)
downloadmisc-fred-dacf7029e270b8d4f11d380b5703db88776e2283.zip
misc-fred-dacf7029e270b8d4f11d380b5703db88776e2283.tar.gz
misc-fred-dacf7029e270b8d4f11d380b5703db88776e2283.tar.bz2
doc-publik: update pages even if there's no "more info" section
-rw-r--r--doc-publik/update-publik-doc-from-mallard.py8
1 files 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()