Skip to content

Commit

Permalink
small changes due to pr comment
Browse files Browse the repository at this point in the history
  • Loading branch information
nadijagraca committed Oct 26, 2023
1 parent 8c7989a commit cbc943b
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions vizro-core/src/vizro/models/_navigation/nav_bar.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ class NavBar(VizroBaseModel):
Args:
pages (Optional[NavPagesType]): See [`NavPagesType`][vizro.models.types.NavPagesType].
Defaults to `None`.
items (List[NavItem]): List of NavItem models. Defaults to `None`.
items (List[NavItem]): List of NavItem models. Defaults to `[]`.
"""

pages: Optional[NavPagesType] = None
items: Optional[List[NavItem]] = None
items: List[NavItem] = []

@_log_call
def pre_build(self):
Expand All @@ -40,12 +40,6 @@ def pre_build(self):
if isinstance(self.pages, dict):
self.items = [NavItem(pages=value) for page, value in self.pages.items()]

@validator("items", always=True)
def _validate_items(cls, items):
if items is not None and not items:
raise ValueError("Ensure this value has at least 1 item.")

return items

@_log_call
def build(self, active_page_id):
Expand Down

0 comments on commit cbc943b

Please sign in to comment.