From 2da1526175da8692febb2a4fba5deab357d75a0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Wed, 6 Mar 2019 16:22:05 +0100 Subject: [PATCH] doc: add a notice on pages living on redmine --- doc-publik/update-publik-doc-from-redmine.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/doc-publik/update-publik-doc-from-redmine.py b/doc-publik/update-publik-doc-from-redmine.py index 0474453..453989e 100644 --- a/doc-publik/update-publik-doc-from-redmine.py +++ b/doc-publik/update-publik-doc-from-redmine.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + from bs4 import BeautifulSoup import html5lib import requests @@ -20,4 +22,16 @@ for cell in TextCell.objects.filter(slug__in=DOCS.keys(), page__snapshot__isnull content = document.find('body') new_content = unicode(content).replace('', '').replace('', '') cell.text = new_content + cell.order = 1 + cell.save() + + url = DOCS[cell.slug].replace('.html', '').decode('utf-8') + cell, created = TextCell.objects.get_or_create( + page=cell.page, + slug='editor-warning', defaults={'order': 0}) + cell.placeholder = 'content' + cell.order = 0 + cell.text = u'''
Cette page est tirée de redmine, l'édition se fait là :
+ %s.
''' % (url, url) + cell.public = False cell.save()