Skip to content

Commit

Permalink
mypy fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Buhle79 committed Feb 18, 2025
1 parent d178feb commit e098c7f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions home/import_content_pages.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def __init__(
self.go_to_page_list_items: dict[PageId, dict[int, list[dict[str, Any]]]] = (
defaultdict(lambda: defaultdict(list))
)
self.import_warnings = []
self.import_warnings: list[ImportWarning] = []

def locale_from_display_name(self, langname: str) -> Locale:
if langname not in self.locale_map:
Expand Down Expand Up @@ -93,15 +93,14 @@ def perform_import(self) -> None:
self.add_go_to_page_list_items()
self.add_media_link(rows)

def add_media_link(self, rows: list["ContentRow"]):
def add_media_link(self, rows: list["ContentRow"]) -> None:
row_num = 0
for i, row in enumerate(rows, start=2):
row_num += 1

if row.media_link:
if row.media_link is not None or row.media_link != "":
self.import_warnings.append(ImportWarning(f"Media link: {row.media_link}" , row_num))
return self.import_warnings

def process_rows(self, rows: list["ContentRow"]) -> None:
# Non-page rows don't have a locale, so we need to remember the last
Expand Down Expand Up @@ -819,6 +818,7 @@ def from_flat(cls, row: dict[str, str], row_num: int) -> "ContentRow":
list_items=list_items,
footer=row.pop("footer", ""),
**row,
import_warnings=[]
)

@property
Expand Down

0 comments on commit e098c7f

Please sign in to comment.