Skip to content

Commit 4e67f4b

Browse files
committed
fix links view mixin to support proper mro
1 parent 2db0ae0 commit 4e67f4b

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

keg_storage/plugin.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,12 @@ def init_cli(self, app: flask.Flask) -> None:
7474

7575

7676
def _disable_csrf(func):
77-
if 'csrf' in flask.current_app.extensions:
78-
return flask.current_app.extensions['csrf'].exempt(func)
77+
try:
78+
if 'csrf' in flask.current_app.extensions:
79+
return flask.current_app.extensions['csrf'].exempt(func)
80+
except RuntimeError as exc:
81+
if 'application context' not in str(exc):
82+
raise
7983
return func
8084

8185

keg_storage_ta/views.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def create_local_storage(root: Union[str, pathlib.Path]) -> keg_storage.LocalFSS
2525
)
2626

2727

28-
class LinkView(BaseView, keg_storage.LinkViewMixin):
28+
class LinkView(keg_storage.LinkViewMixin, BaseView):
2929
blueprint = public_bp
3030
url = '/storage'
3131

0 commit comments

Comments
 (0)