Browse Source

Remove unused import and clean control flow

pull/1360/head
Keyan Pishdadian 10 years ago
parent
commit
7b080355f5
  1. 7
      flask/wrappers.py

7
flask/wrappers.py

@ -13,7 +13,7 @@ from werkzeug.wrappers import Request as RequestBase, Response as ResponseBase
from werkzeug.exceptions import BadRequest from werkzeug.exceptions import BadRequest
from . import json from . import json
from .globals import _request_ctx_stack, current_app from .globals import _request_ctx_stack
_missing = object() _missing = object()
@ -175,9 +175,8 @@ class Request(RequestBase):
.. versionadded:: 0.8 .. versionadded:: 0.8
""" """
ctx = _request_ctx_stack.top ctx = _request_ctx_stack.top
if ctx is not None: if ctx is not None and ctx.app.config.get('DEBUG', False):
if ctx.app.config.get('DEBUG', False): raise BadRequest('Failed to decode JSON object: {0}'.format(e))
raise BadRequest('Failed to decode JSON object: {0}'.format(e))
raise BadRequest() raise BadRequest()
def _load_form_data(self): def _load_form_data(self):

Loading…
Cancel
Save