Skip to content

Commit

Permalink
Merge pull request #6 from jul/patch-1
Browse files Browse the repository at this point in the history
More meaningful exception on non-dict YAML metadata.
  • Loading branch information
SimonSapin committed Sep 20, 2012
2 parents 8f2b857 + 146e0f1 commit 95cd9e8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion flask_flatpages/__init__.py
Expand Up @@ -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):
Expand Down

0 comments on commit 95cd9e8

Please sign in to comment.