Skip to content

Commit 6f3280e

Browse files
committed
bump attemps to 50, add better commenting and changelog
1 parent 5271fcc commit 6f3280e

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

Diff for: CHANGELOG.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,14 @@
22
All notable changes to this project will be documented in this file.
33
This project adheres to [Semantic Versioning](http://semver.org/).
44

5-
## [2.0.7] - [Unreleased]
5+
## [2.0.7] - 2017-04-07
66
### Updated
77
- Updated `plotly.min.js` to version 1.25.0 for `plotly.offline`.
88
- See [the plotly.js CHANGELOG](https://github.com/plotly/plotly.js/blob/master/CHANGELOG.md) for additional information regarding the updates.
99

10+
### Added
11+
- Added check to verify the share key is enabled when secret charts are created.
12+
1013
## [2.0.6] - 2017-03-20
1114
### Added
1215
- Added a new mimetype 'text/vnd.plotly.v1+html' for `iplot` outputs.
@@ -37,8 +40,6 @@ Note: This release's installation was broken. It has been removed from PyPI
3740
See [https://github.com/nteract/nteract/pull/662](https://github.com/nteract/nteract/pull/662)
3841
for the associated PR in nteract.
3942
- As part of the above, plotly output now prints with a [custom mimetype](https://github.com/plotly/plotly.py/blob/f65724f06b894a5db94245ee4889c632b887d8ce/plotly/offline/offline.py#L348) - `application/vnd.plotly.v1+json`
40-
41-
### Added
4243
- `memoize` decorator added to `plotly.utils`
4344

4445
### Changed

Diff for: plotly/plotly/plotly.py

+9-2
Original file line numberDiff line numberDiff line change
@@ -1308,10 +1308,17 @@ def add_share_key_to_url(plot_url, attempt=0):
13081308
body = {'share_key_enabled': True, 'world_readable': False}
13091309
response = v2.files.update(fid, body)
13101310

1311+
# Sometimes a share key is added, but access is still denied.
1312+
# Check that share_key_enabled is set to true and
1313+
# retry if this is not the case
1314+
# https://github.com/plotly/streambed/issues/4089
13111315
if not v2.files.retrieve(fid).json()['share_key_enabled']:
13121316
attempt += 1
1313-
if attempt == 10:
1314-
raise Exception
1317+
if attempt == 50:
1318+
raise exceptions.PlotlyError(
1319+
"The sharekey could not be enabled at this time so the graph "
1320+
"is saved as private. Try again to save as 'secret' later."
1321+
)
13151322
add_share_key_to_url(plot_url, attempt)
13161323

13171324
url_share_key = plot_url + '?share_key=' + response.json()['share_key']

0 commit comments

Comments
 (0)