Skip to content

Commit

Permalink
fix links view mixin to support proper mro
Browse files Browse the repository at this point in the history
  • Loading branch information
guruofgentoo committed Mar 1, 2022
1 parent 2db0ae0 commit 4e67f4b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions keg_storage/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,12 @@ def init_cli(self, app: flask.Flask) -> None:


def _disable_csrf(func):
if 'csrf' in flask.current_app.extensions:
return flask.current_app.extensions['csrf'].exempt(func)
try:
if 'csrf' in flask.current_app.extensions:
return flask.current_app.extensions['csrf'].exempt(func)
except RuntimeError as exc:
if 'application context' not in str(exc):
raise
return func


Expand Down
2 changes: 1 addition & 1 deletion keg_storage_ta/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def create_local_storage(root: Union[str, pathlib.Path]) -> keg_storage.LocalFSS
)


class LinkView(BaseView, keg_storage.LinkViewMixin):
class LinkView(keg_storage.LinkViewMixin, BaseView):
blueprint = public_bp
url = '/storage'

Expand Down

0 comments on commit 4e67f4b

Please sign in to comment.