Skip to content

Make #3351 acceptable only for sync version (async version has self-owned if not config.suppress_callback_exceptions ... block) #3359

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

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 20 additions & 20 deletions dash/dash.py
Original file line number Diff line number Diff line change
Expand Up @@ -2491,27 +2491,27 @@ def update(pathname_, search_, **states):
_validate.check_for_duplicate_pathnames(_pages.PAGE_REGISTRY)
_validate.validate_registry(_pages.PAGE_REGISTRY)

# Set validation_layout
if not self.config.suppress_callback_exceptions:
layout = self.layout
if not isinstance(layout, list):
layout = [
# pylint: disable=not-callable
self.layout()
if callable(self.layout)
else self.layout
]
self.validation_layout = html.Div(
[
page["layout"]()
if callable(page["layout"])
else page["layout"]
for page in _pages.PAGE_REGISTRY.values()
# Set validation_layout
if not self.config.suppress_callback_exceptions:
layout = self.layout
if not isinstance(layout, list):
layout = [
# pylint: disable=not-callable
self.layout()
if callable(self.layout)
else self.layout
]
+ layout
)
if _ID_CONTENT not in self.validation_layout:
raise Exception("`dash.page_container` not found in the layout")
self.validation_layout = html.Div(
[
page["layout"]()
if callable(page["layout"])
else page["layout"]
for page in _pages.PAGE_REGISTRY.values()
]
+ layout
)
if _ID_CONTENT not in self.validation_layout:
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this one need to be indented one more level too.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If you mean another additional indented for checking "if _ID_CONTENT ... " - then as far as I understand, no. Here, only the self.validation_layout property is redefined if necessary. It can also be set in the layout() method/property, and the checking should occur in both cases.

raise Exception("`dash.page_container` not found in the layout")

# Update the page title on page navigation
self.clientside_callback(
Expand Down