Skip to content

Commit 7b08035

Browse files
committed
Remove unused import and clean control flow
1 parent 44da905 commit 7b08035

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

flask/wrappers.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
from werkzeug.exceptions import BadRequest
1414

1515
from . import json
16-
from .globals import _request_ctx_stack, current_app
16+
from .globals import _request_ctx_stack
1717

1818
_missing = object()
1919

@@ -175,9 +175,8 @@ def on_json_loading_failed(self, e):
175175
.. versionadded:: 0.8
176176
"""
177177
ctx = _request_ctx_stack.top
178-
if ctx is not None:
179-
if ctx.app.config.get('DEBUG', False):
180-
raise BadRequest('Failed to decode JSON object: {0}'.format(e))
178+
if ctx is not None and ctx.app.config.get('DEBUG', False):
179+
raise BadRequest('Failed to decode JSON object: {0}'.format(e))
181180
raise BadRequest()
182181

183182
def _load_form_data(self):

0 commit comments

Comments
 (0)