Skip to content

Commit 20043c0

Browse files
committed
temporary share key fix
1 parent 8fb58d5 commit 20043c0

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

Diff for: plotly/plotly/plotly.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import copy
2020
import json
2121
import os
22+
import time
2223
import warnings
2324
import webbrowser
2425

@@ -1304,17 +1305,19 @@ def add_share_key_to_url(plot_url, attempt=0):
13041305
username = urlsplit.path.split('/')[1].split('~')[1]
13051306
idlocal = urlsplit.path.split('/')[2]
13061307
fid = '{}:{}'.format(username, idlocal)
1307-
13081308
body = {'share_key_enabled': True, 'world_readable': False}
13091309
response = v2.files.update(fid, body)
13101310

13111311
# Sometimes a share key is added, but access is still denied.
13121312
# Check that share_key_enabled is set to true and
13131313
# retry if this is not the case
13141314
# https://github.com/plotly/streambed/issues/4089
1315-
if not v2.files.retrieve(fid).json()['share_key_enabled']:
1315+
time.sleep(4)
1316+
share_key_enabled = v2.files.retrieve(fid).json()['share_key_enabled']
1317+
if not share_key_enabled:
13161318
attempt += 1
13171319
if attempt == 50:
1320+
print('Raising exception')
13181321
raise exceptions.PlotlyError(
13191322
"The sharekey could not be enabled at this time so the graph "
13201323
"is saved as private. Try again to save as 'secret' later."

Diff for: plotly/version.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = '2.0.13'
1+
__version__ = '2.0.14'

0 commit comments

Comments
 (0)