From 2acd936bf483779e1234aac442e4581ed033eb16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Charles=20Fl=C3=A8che?= Date: Sat, 14 Oct 2017 22:31:49 +0700 Subject: [PATCH] Remove Content._summary and direclty access metadata on request --- pelican/contents.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/pelican/contents.py b/pelican/contents.py index 0e919ee8..725bc039 100644 --- a/pelican/contents.py +++ b/pelican/contents.py @@ -149,10 +149,6 @@ class Content(object): self.metadata[key] = value setattr(self, key.lower(), value) - # store the summary metadata if it is set - if 'summary' in self.metadata: - self._summary = self.metadata['summary'] - signals.content_object_init.send(self) def __str__(self): @@ -346,8 +342,8 @@ class Content(object): This is based on the summary metadata if set, otherwise truncate the content. """ - if hasattr(self, '_summary'): - return self._summary + if 'summary' in self.metadata: + return self.metadata['summary'] if self.settings['SUMMARY_MAX_LENGTH'] is None: return self.content