From 497271ea7ea9fe8c35ab112a9e4cdc209215a3a5 Mon Sep 17 00:00:00 2001 From: Bryan Brattlof Date: Fri, 23 Nov 2018 16:20:31 -0600 Subject: [PATCH] List files missing tag needed to order content --- pelican/utils.py | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/pelican/utils.py b/pelican/utils.py index 50d428a5..32f508ae 100644 --- a/pelican/utils.py +++ b/pelican/utils.py @@ -763,9 +763,19 @@ def order_content(content_list, order_by='slug'): content_list.sort(key=attrgetter(order_by), reverse=order_reversed) except AttributeError: - logger.warning( - 'There is no "%s" attribute in the item ' - 'metadata. Defaulting to slug order.', order_by) + for content in content_list: + try: + getattr(content, order_by) + except AttributeError: + logger.warning( + 'There is no "%s" attribute in "%s". ' + 'Defaulting to slug order.', + order_by, + content.get_relative_source_path(), + extra={ + 'limit_msg': ('More files are missing ' + 'the needed attribute.') + }) else: logger.warning( 'Invalid *_ORDER_BY setting (%s).'