Commit a6dfe036 by Chris Wanstrath

check the context before hitting a view method

parent 06c5544e
...@@ -36,7 +36,9 @@ class View(object): ...@@ -36,7 +36,9 @@ class View(object):
return self.__class__.__name__ return self.__class__.__name__
def get(self, attr, default): def get(self, attr, default):
if hasattr(self, attr): if attr in self.context:
return self.context[attr]
elif hasattr(self, attr):
return getattr(self, attr)() return getattr(self, attr)()
else: else:
return default return default
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment