diff piecrust/routing.py @ 661:2f780b191541

internal: Fix a bug with registering taxonomy terms that are not strings. Some objects, like the blog data provider's taxnonomy entries, can render as strings, but are objects themselves. When registering them as "used terms", we need to use their string representation.
author Ludovic Chabant <ludovic@chabant.com>
date Tue, 01 Mar 2016 22:26:09 -0800
parents 6b6c5442c790
children ab5c6a8ae90a
line wrap: on
line diff
--- a/piecrust/routing.py	Sat Feb 27 22:00:52 2016 -0800
+++ b/piecrust/routing.py	Tue Mar 01 22:26:09 2016 -0800
@@ -330,9 +330,9 @@
 
                 # We need to register this use of a taxonomy term.
                 if len(values) == 1:
-                    registered_values = values[0]
+                    registered_values = str(values[0])
                 else:
-                    registered_values = tuple(values)
+                    registered_values = tuple([str(v) for v in values])
                 eis = self.app.env.exec_info_stack
                 cpi = eis.current_page_info.render_ctx.current_pass_info
                 if cpi: