1
0
Fork 0
forked from github/pelican

Merge pull request #2439 from mosra/settings-paginated-templates-deprecation-fix

Fix PAGINATED_DIRECT_TEMPLATES backward compatibility handling to not crash
This commit is contained in:
Justin Mayer 2018-11-11 17:40:09 +01:00 committed by GitHub
commit 7f7448ef76
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 30 additions and 0 deletions

View file

@ -323,6 +323,11 @@ def handle_deprecated_settings(settings):
'PAGINATED_DIRECT_TEMPLATES', 'PAGINATED_TEMPLATES')
logger.warning(message)
# set PAGINATED_TEMPLATES
if 'PAGINATED_TEMPLATES' not in settings:
settings['PAGINATED_TEMPLATES'] = {
'tag': None, 'category': None, 'author': None}
for t in settings['PAGINATED_DIRECT_TEMPLATES']:
if t not in settings['PAGINATED_TEMPLATES']:
settings['PAGINATED_TEMPLATES'][t] = None