Adding a summary no more make Pelican crashes

Setting pelican.readers.Article.summary was impossible and raised an
exception because pelican.readers.Article.summary was a @property
This commit is contained in:
Skami18 2011-10-25 18:31:17 +02:00
commit 0b6896a0ab

View file

@ -88,6 +88,10 @@ class Page(object):
if not hasattr(self, 'status'):
self.status = settings['DEFAULT_STATUS']
# set summary
if not hasattr(self, 'summary'):
self.summary = truncate_html_words(self.content, 50)
def check_properties(self):
"""test that each mandatory property is set."""
for prop in self.mandatory_properties:
@ -102,9 +106,6 @@ class Page(object):
content = self._content
return content
@property
def summary(self):
return truncate_html_words(self.content, 50)
class Article(Page):
mandatory_properties = ('title', 'date', 'category')