diff piecrust/baking/baker.py @ 324:65e6d72f3877

bake/serve: Fix how taxonomy index pages are setup and rendered. * Properly use the taxonomy's setting name where appropriate. * Delete duplicated (and sometimes incorrect) code in 2 places to setup filtering on an index page and consolidate it on the `PageRenderingContext`. * Add unit tests.
author Ludovic Chabant <ludovic@chabant.com>
date Sun, 29 Mar 2015 23:08:37 -0700
parents 1f4c3dae1fe8
children 91b07f9efdc1
line wrap: on
line diff
--- a/piecrust/baking/baker.py	Sun Mar 29 23:05:03 2015 -0700
+++ b/piecrust/baking/baker.py	Sun Mar 29 23:08:37 2015 -0700
@@ -202,12 +202,12 @@
                 # pages.
                 if (not prev_entry and cur_entry and
                         cur_entry.was_baked_successfully):
-                    changed_terms = cur_entry.config.get(tax.name)
+                    changed_terms = cur_entry.config.get(tax.setting_name)
                 elif (prev_entry and cur_entry and
                         cur_entry.was_baked_successfully):
                     changed_terms = []
-                    prev_terms = prev_entry.config.get(tax.name)
-                    cur_terms = cur_entry.config.get(tax.name)
+                    prev_terms = prev_entry.config.get(tax.setting_name)
+                    cur_terms = cur_entry.config.get(tax.setting_name)
                     if tax.is_multiple:
                         if prev_terms is not None:
                             changed_terms += prev_terms