1
0
Fork 0
forked from github/pelican

Pelican show a warning instead of raising an exception if the author of an article is not found an there is no settings file

This commit is contained in:
Skami18 2011-07-26 17:45:15 +02:00
commit b892f758a8

View file

@ -2,6 +2,7 @@
from pelican.utils import slugify, truncate_html_words
from pelican.log import *
from pelican.settings import _DEFAULT_CONFIG
from os import getenv
class Page(object):
"""Represents a page
@ -34,6 +35,9 @@ class Page(object):
if not hasattr(self, 'author'):
if 'AUTHOR' in settings:
self.author = settings['AUTHOR']
else:
self.author = getenv('USER', 'John Doe')
warning("Author of `{0}' unknow, assuming that his name is `{1}'".format(filename or self.title, self.author).decode("utf-8"))
# manage languages
self.in_default_lang = True