Browse files

Merge pull request #6 from jul/patch-1

More meaningful exception on non-dict YAML metadata.
  • Loading branch information...
2 parents 8f2b857 + 146e0f1 commit 95cd9e807d09a98a20368b7d8230f3126381b22b @SimonSapin committed Sep 20, 2012
Showing with 3 additions and 1 deletion.
  1. +3 −1 flask_flatpages/__init__.py
View
4 flask_flatpages/__init__.py
@@ -86,7 +86,9 @@ def meta(self):
# yaml.safe_load('- 1\n- a') -> [1, 'a']
if not meta:
return {}
- assert isinstance(meta, dict)
+ if not isinstance(meta, dict):
+ raise Exception("Excpecting a valid dict in meta <%(_meta_yaml)s> for page at <%(path)s>" %
+ self.__dict__)
return meta
def __getitem__(self, name):

0 comments on commit 95cd9e8

Please sign in to comment.