Skip to content
Open
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
11 changes: 11 additions & 0 deletions dash_auth/current_user_hook/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import flask

from dash import hooks

@hooks.custom_data("user")
def custom_data_func(_ctx):
try:
cu = flask.session["user"]
except AttributeError as e:

Check warning on line 9 in dash_auth/current_user_hook/__init__.py

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Remove the unused local variable "e".

See more on https://sonarcloud.io/project/issues?id=plotly_dash-auth&issues=AZ5Q5MR5kDEmer1nhDJc&open=AZ5Q5MR5kDEmer1nhDJc&pullRequest=168
cu = {}
return cu
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
},
python_requires=">=3.8",
include_package_data=True,
entrypoints={"dash_hooks": ["current_user_hook = current_user_hook"]},
url='https://plotly.com/dash',
classifiers=[
'Development Status :: 5 - Production/Stable',
Expand Down