Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set default content status to blank string instead of None #2610

Merged
merged 1 commit into from
Aug 21, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -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)).
4 changes: 3 additions & 1 deletion pelican/contents.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,9 @@ def __init__(self, content, metadata=None, settings=None,

# 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:
Expand Down