Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: cms/converters.py

Issue 29753617: Issue 6545 - get_pages_metadata now returns all pages (Closed)
Patch Set: Rebase, changes comments to add citation to explain weird logic chain Created May 6, 2018, 10:59 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tests/expected_output/en/sitemap » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cms/converters.py
===================================================================
--- a/cms/converters.py
+++ b/cms/converters.py
@@ -469,20 +469,16 @@
_format)
page_data = utils.extract_page_metadata(data)[0]
page_data.setdefault('page', page_name)
if self.filter_metadata(filters, page_data) is True:
return_data.append(page_data)
return return_data
def filter_metadata(self, filters, metadata):
- # if only the page key is in the metadata then there
- # was no user defined metadata
- if metadata.keys() == ['page']:
- return False
if filters is None:
return True
for filter_name, filter_value in filters.items():
if filter_name not in metadata:
return False
if isinstance(metadata[filter_name], list):
if isinstance(filter_value, basestring):
filter_value = [filter_value]
« no previous file with comments | « no previous file | tests/expected_output/en/sitemap » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld