Skip to content

check that share key is enabled #726

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 7, 2017
Merged

check that share key is enabled #726

merged 2 commits into from
Apr 7, 2017

Conversation

cldougl
Copy link
Member

@cldougl cldougl commented Apr 6, 2017

No description provided.

@cldougl cldougl requested review from chriddyp and Kully April 6, 2017 22:12
@@ -1308,7 +1308,14 @@ def add_share_key_to_url(plot_url):
body = {'share_key_enabled': True, 'world_readable': False}
response = v2.files.update(fid, body)

return plot_url + '?share_key=' + response.json()['share_key']
if not v2.files.retrieve(fid).json()['share_key_enabled']:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd add a comment here about why we're trying multiple times

return plot_url + '?share_key=' + response.json()['share_key']
if not v2.files.retrieve(fid).json()['share_key_enabled']:
attempt += 1
if attempt == 10:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd be OK with bumping this up to 50 even

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 bumped to 50

if not v2.files.retrieve(fid).json()['share_key_enabled']:
attempt += 1
if attempt == 10:
raise Exception
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're trying to wrap everything in plotly exceptions so that users can catch them. So just: raise exceptions.PlotlyException (or something)

@chriddyp
Copy link
Member

chriddyp commented Apr 6, 2017

💃 once you consider my comments

@chriddyp chriddyp closed this Apr 6, 2017
@chriddyp chriddyp reopened this Apr 6, 2017
@cldougl cldougl merged commit 3efe833 into master Apr 7, 2017
@cldougl cldougl deleted the secret_fix branch July 21, 2017 14:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants