Mercurial > piecrust2
changeset 448:a17774094db8
serve: Fix bug with creating routing metadata from the URL.
This is still using the hack for year/month/day values :(
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Mon, 06 Jul 2015 21:27:04 -0700 |
parents | aefe70229fdd |
children | 30f2c2a595f5 |
files | piecrust/routing.py |
diffstat | 1 files changed, 5 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/piecrust/routing.py Sun Jul 05 00:09:41 2015 -0700 +++ b/piecrust/routing.py Mon Jul 06 21:27:04 2015 -0700 @@ -132,6 +132,11 @@ for k in missing_keys: route_metadata[k] = '' + # TODO: fix this hard-coded shit + for key in ['year', 'month', 'day']: + if key in route_metadata and isinstance(route_metadata[key], str): + route_metadata[key] = int(route_metadata[key]) + return route_metadata def getUri(self, route_metadata, *, sub_num=1):