doc-publik: update pages even if there's no "more info" section

This commit is contained in:
Frédéric Péters 2020-03-10 10:15:45 +01:00
parent baa110467b
commit dacf7029e2
1 changed files with 5 additions and 3 deletions

View File

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