Skip to content

Commit 5ff348b

Browse files
Ensure users are added to the correct file during login hashing (#316)
Signed-off-by: Emmanuel Ferdman <[email protected]>
1 parent 7ceefb8 commit 5ff348b

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

explainerdashboard/dashboards.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -879,7 +879,7 @@ def from_config(cls, arg1, arg2=None, **update_params):
879879
880880
db = ExplainerDashboard.from_config("dashboard.yaml")
881881
882-
You can also load the explainerfile seperately:
882+
You can also load the explainerfile separately:
883883
884884
db = ExplainerDashboard.from_config("explainer.joblib", "dashboard.yaml")
885885
@@ -1018,7 +1018,7 @@ def to_yaml(
10181018

10191019
def _store_params(self, no_store=None, no_attr=None, no_param=None):
10201020
"""Stores the parameter of the class to instance attributes and
1021-
to a ._stored_params dict. You can optionall exclude all or some
1021+
to a ._stored_params dict. You can optionally exclude all or some
10221022
parameters from being stored.
10231023
10241024
Args:
@@ -1523,7 +1523,7 @@ def __init__(
15231523
)
15241524

15251525
assert len(set(self.dashboard_names)) == len(self.dashboard_names), (
1526-
f"All dashboard .name properties should be unique, but received the folowing: {self.dashboard_names}"
1526+
f"All dashboard .name properties should be unique, but received the following: {self.dashboard_names}"
15271527
)
15281528
illegal_names = list(set(self.dashboard_names) & self.__reserved_names)
15291529
assert not illegal_names, (
@@ -1613,7 +1613,7 @@ def add_dashboard(self, dashboard: ExplainerDashboard, **kwargs):
16131613
f"The following .name properties for dashboards are not allowed: {dashboard.name}!"
16141614
)
16151615

1616-
# If the dashboard name is unkown we create it
1616+
# If the dashboard name is unknown we create it
16171617
update_params = dict(
16181618
server=self.app,
16191619
name=dashboard.name,
@@ -1689,7 +1689,7 @@ def from_config(cls, config: Union[dict, str, Path], **update_params):
16891689
config = deepcopy(config)
16901690

16911691
assert "explainerhub" in config, (
1692-
"Misformed yaml: explainerhub yaml file should start with 'explainerhub:'!"
1692+
"Malformed yaml: explainerhub yaml file should start with 'explainerhub:'!"
16931693
)
16941694

16951695
config = config["explainerhub"]
@@ -1793,7 +1793,7 @@ def to_yaml(
17931793

17941794
def _store_params(self, no_store=None, no_attr=None, no_param=None):
17951795
"""Stores the parameter of the class to instance attributes and
1796-
to a ._stored_params dict. You can optionall exclude all or some
1796+
to a ._stored_params dict. You can optionally exclude all or some
17971797
parameters from being stored.
17981798
17991799
Args:
@@ -1894,7 +1894,7 @@ def _instantiate_dashboards(self, dashboards, **kwargs):
18941894

18951895
@staticmethod
18961896
def _validate_users_file(users_file: Path):
1897-
"""validat that user_json is a well formed .json file.
1897+
"""validate that user_json is a well formed .json file.
18981898
If it does not exist, then create an empty .json file.
18991899
"""
19001900
if users_file is not None:
@@ -1951,7 +1951,7 @@ def _hash_logins(self, logins: List[List], add_to_users_file: bool = False):
19511951
username=username,
19521952
password=generate_password_hash(password, method="pbkdf2:sha256"),
19531953
)
1954-
if add_to_users_file and self.users_jfile is not None:
1954+
if add_to_users_file and self.users_file is not None:
19551955
self._add_user_to_file(self.users_file, username, password)
19561956
return logins_dict
19571957

@@ -2435,7 +2435,7 @@ def to_zip(self, filename: Union[str, Path], name: str = "explainerhub"):
24352435
print(f"Saved static html version of ExplainerHub to {filename}...")
24362436

24372437
def _hub_page(self, route, static=False):
2438-
"""Returns a html bootstrap wrapper around a particular flask route (hosting an ExplainerDashbaord)
2438+
"""Returns a html bootstrap wrapper around a particular flask route (hosting an ExplainerDashboard)
24392439
It contains:
24402440
- a NavBar with links to all dashboards
24412441
- an iframe containing the flask route
@@ -2511,7 +2511,7 @@ def _add_flask_routes(self, app):
25112511
"""adds the index route "/" with the index_page
25122512
and routes for each dashboard with a navbar and an iframe, e.g. "/_dashboard1"
25132513
2514-
If you pass no_index to the contructor, this method does not get called.
2514+
If you pass no_index to the constructor, this method does not get called.
25152515
25162516
Args:
25172517
app (flask.Flask): flask app to add routes to.
@@ -2696,7 +2696,7 @@ def terminate(self, port=None, token=None):
26962696
print(f"Something seems to have failed: {e}")
26972697

26982698
def _run_app(self, app, **kwargs):
2699-
"""Starts the dashboard either inline or in a seperate tab
2699+
"""Starts the dashboard either inline or in a separate tab
27002700
27012701
:param app: the JupyterDash app to be run
27022702
:type mode: JupyterDash app instance

0 commit comments

Comments
 (0)