Skip to content

Commit 6e4622c

Browse files
committed
refactor get_config_file guts so returned_objs is validated after grabbed
1 parent 0c189f2 commit 6e4622c

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

plotly/tools.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -276,9 +276,20 @@ def get_config_file(*args):
276276
"""
277277
if check_file_permissions():
278278
ensure_local_plotly_files() # make sure what's there is OK
279-
return utils.load_json_dict(CONFIG_FILE, *args)
279+
returned_obj = utils.load_json_dict(CONFIG_FILE, *args)
280280
else:
281-
return FILE_CONTENT[CONFIG_FILE]
281+
returned_obj = FILE_CONTENT[CONFIG_FILE]
282+
283+
list_of_domains = []
284+
for domain in ['plotly_domain', 'plotly_api_domain']:
285+
if domain in returned_obj:
286+
list_of_domains.append(returned_obj[domain])
287+
288+
validate_domains(*list_of_domains)
289+
290+
return returned_obj
291+
292+
282293

283294

284295
def reset_config_file():

0 commit comments

Comments
 (0)