Browse Source

Change logic to support when current_app is not available

pull/1360/head
Keyan Pishdadian 10 years ago
parent
commit
19df249c89
  1. 9
      flask/wrappers.py

9
flask/wrappers.py

@ -174,10 +174,11 @@ class Request(RequestBase):
.. versionadded:: 0.8 .. versionadded:: 0.8
""" """
if current_app.config['DEBUG']: ctx = _request_ctx_stack.top
raise BadRequest(e) if ctx is not None:
else: if ctx.app.config.get('DEBUG', False):
raise BadRequest() raise BadRequest(e)
raise BadRequest()
def _load_form_data(self): def _load_form_data(self):
RequestBase._load_form_data(self) RequestBase._load_form_data(self)

Loading…
Cancel
Save