From dab40dddd08024b01c6d0798bc61ba31896fe06f Mon Sep 17 00:00:00 2001 From: Bertrand Benjamin Date: Fri, 14 Apr 2023 13:57:39 +0200 Subject: [PATCH] Fix: " et ' --- plugins/always_modified.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/plugins/always_modified.py b/plugins/always_modified.py index 0f2578b..c0bff4b 100644 --- a/plugins/always_modified.py +++ b/plugins/always_modified.py @@ -5,16 +5,18 @@ If "modified" date/time is not defined in article metadata, fall back to the "cr from pelican import signals from pelican.contents import Content, Article + def add_modified(content): if not isinstance(content, Article): return - - if not content.settings.get('ALWAYS_MODIFIED', False): + + if not content.settings.get("ALWAYS_MODIFIED", False): return - if hasattr(content, 'date') and not hasattr(content, 'modified'): + if hasattr(content, "date") and not hasattr(content, "modified"): content.modified = content.date content.locale_modified = content.locale_date - + + def register(): signals.content_object_init.connect(add_modified)