diff options
author | Mark McClain <mark.mcclain@shootq.com> | 2011-06-30 18:54:12 -0400 |
---|---|---|
committer | Mark McClain <mark.mcclain@shootq.com> | 2011-06-30 18:54:12 -0400 |
commit | 36fafb7bb0683616170851c26daa53d217065805 (patch) | |
tree | f8a4da1a11d0db0382dc6258a701161731e95bbe /pecan/core.py | |
parent | 657f886bc95771b7ab73a2f25f6c9d3942d6681b (diff) | |
download | pecan-36fafb7bb0683616170851c26daa53d217065805.tar.gz |
Set state.controller to known state at start of each request.
Previously, the state could float, so tests that raise errors caused the
state to not reset and thus test ordering became important. Also,
verified that hook test actually behaved as expected.
{{BUG}}
Diffstat (limited to 'pecan/core.py')
-rw-r--r-- | pecan/core.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/pecan/core.py b/pecan/core.py index 8650b2d..e722ff5 100644 --- a/pecan/core.py +++ b/pecan/core.py @@ -138,7 +138,7 @@ class ValidationException(ForwardRequestException): ''' def __init__(self, location=None, errors={}): - if hasattr(state, 'controller'): + if state.controller is not None: cfg = _cfg(state.controller) else: cfg = {} @@ -491,6 +491,7 @@ class Pecan(object): state.response = Response() state.hooks = [] state.app = self + state.controller = None # handle the request try: |