diff --git a/dash/dash.py b/dash/dash.py index 8c535758d2..92c4a5d542 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(