From b2da535fecafa7a81feee2dd5b19eb1fffcc9a94 Mon Sep 17 00:00:00 2001 From: MinchinWeb Date: Tue, 20 Aug 2019 19:39:14 -0600 Subject: [PATCH] Set default content status to a blank string rather than `None`. Fixes #2558. Fixes issues encountered by comment plugins among others c.f. [1](https://github.com/bstpierre/pelican-comments/pull/4), [2](https://github.com/Scheirle/pelican_comment_system/issues/8), [3](https://github.com/Scheirle/pelican_comment_system/pull/7) --- RELEASE.md | 7 +++++++ pelican/contents.py | 4 +++- 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 RELEASE.md diff --git a/RELEASE.md b/RELEASE.md new file mode 100644 index 00000000..dccbdff8 --- /dev/null +++ b/RELEASE.md @@ -0,0 +1,7 @@ +Release type: patch + +Set default content status to a blank string rather than `None`. Fixes +[#2558](https://github.com/getpelican/pelican/issues/2558). Fixes issues +encountered by comment plugins among others +([1](https://github.com/bstpierre/pelican-comments/pull/4), +[2](https://github.com/Scheirle/pelican_comment_system/issues/8)). diff --git a/pelican/contents.py b/pelican/contents.py index 9292f14f..74524d60 100644 --- a/pelican/contents.py +++ b/pelican/contents.py @@ -141,7 +141,9 @@ class Content(object): # manage status if not hasattr(self, 'status'): - self.status = getattr(self, 'default_status', None) + # using None as the default here breaks comment plugins (and + # probably others) + self.status = getattr(self, 'default_status', '') # store the summary metadata if it is set if 'summary' in metadata: