From ade9bc860f6961c5ab59119559b9830147c2b030 Mon Sep 17 00:00:00 2001 From: Serhii Lychko Date: Tue, 1 Jul 2025 16:17:04 +0300 Subject: [PATCH] Make #3351 acceptable only for sync version (async version has self-owned if not config.suppress_callback_exceptions ... block) --- dash/dash.py | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/dash/dash.py b/dash/dash.py index cf6d0f43f1..b1e92e7286 100644 --- a/dash/dash.py +++ b/dash/dash.py @@ -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: + raise Exception("`dash.page_container` not found in the layout") # Update the page title on page navigation self.clientside_callback(