Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,5 @@ jobs:
run: pip install tox
- name: Run Tox
run: tox -e py
- name: Run Tox Flask 1
run: tox -e flask1
10 changes: 5 additions & 5 deletions flask_jwt_extended/view_decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,12 +121,12 @@ def decorator(*args, **kwargs):
verify_jwt_in_request(optional, fresh, refresh, locations)

# Compatibility with flask < 2.0
try:
if hasattr(current_app, "ensure_sync") and callable(
getattr(current_app, "ensure_sync", None)
):
return current_app.ensure_sync(fn)(*args, **kwargs)
except AttributeError as e: # pragma: no cover
if str(e) != "'Flask' object has no attribute 'ensure_sync'":
raise
return fn(*args, **kwargs)

return fn(*args, **kwargs) # pragma: no cover

return decorator

Expand Down
3 changes: 2 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# and then run "tox" from this directory.

[tox]
envlist = py36,py37,py38,py39,pypy3,coverage,style,docs
envlist = py36,py37,py38,py39,pypy3,flask1,coverage,style,docs

[testenv]
commands =
Expand All @@ -13,6 +13,7 @@ deps =
pytest
cryptography
python-dateutil
flask1: flask == 1.1.4

[testenv:coverage]
commands =
Expand Down