Skip to content

Commit af05d1b

Browse files
committed
get_credentials now ignores user-supplied 'falsey' values
1 parent 42cc384 commit af05d1b

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

plotly/plotly/plotly.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -81,13 +81,12 @@ def get_plot_options():
8181

8282

8383
def get_credentials():
84-
""" Returns a copy of the user supplied credentials.
85-
"""
86-
global _credentials
87-
if ('username' in _credentials) and ('api_key' in _credentials):
88-
return copy.copy(_credentials)
89-
else:
90-
return tools.get_credentials_file()
84+
"""Returns the credentials that will be sent to plotly."""
85+
credentials = tools.get_credentials_file()
86+
for credentials_key in credentials:
87+
if _credentials.get(credentials_key):
88+
credentials[credentials_key] = _credentials[credentials_key]
89+
return credentials
9190

9291

9392
### plot stuff ###

0 commit comments

Comments
 (0)