Skip to content

Commit e6ecef6

Browse files
Merge pull request #2439 from plotly/bug_2437
Don't disable validation when constructing FigureWidget's template.
2 parents 280e13c + bab9d25 commit e6ecef6

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

packages/python/plotly/plotly/basedatatypes.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ class BaseFigure(object):
3737
}
3838

3939
_set_trace_uid = False
40+
_allow_disable_validation = True
4041

4142
# Constructor
4243
# -----------
@@ -1947,7 +1948,8 @@ def _initialize_layout_template(self):
19471948
if self._layout_obj._props.get("template", None) is None:
19481949
if pio.templates.default is not None:
19491950
# Assume default template is already validated
1950-
self._layout_obj._validate = False
1951+
if self._allow_disable_validation:
1952+
self._layout_obj._validate = False
19511953
try:
19521954
template_dict = pio.templates[pio.templates.default]
19531955
self._layout_obj.template = template_dict

packages/python/plotly/plotly/basewidget.py

+1
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ class BaseFigureWidget(BaseFigure, widgets.DOMWidget):
101101
_last_trace_edit_id = Integer(0).tag(sync=True)
102102

103103
_set_trace_uid = True
104+
_allow_disable_validation = False
104105

105106
# Constructor
106107
# -----------

0 commit comments

Comments
 (0)