Skip to content

Commit

Permalink
Remove redirect handler
Browse files Browse the repository at this point in the history
  • Loading branch information
brylie committed Jun 18, 2023
1 parent b9d8e63 commit c115196
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions content_migration/management/import_magazine_authors_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
PersonIndexPage,
)
from content_migration.management.shared import (
create_permanent_redirect,
parse_csv_file,
)

Expand Down Expand Up @@ -147,7 +146,6 @@ def import_author_records(authors_list: list[dict]) -> None:
desc="Primary Author records",
unit="row",
):
author_entity = None
author_type = author["author_type"]

# Don't import duplicate authors
Expand All @@ -161,22 +159,16 @@ def import_author_records(authors_list: list[dict]) -> None:
continue
else:
if author_type == "meeting":
author_entity = create_meeting(author, meeting_index_page)
create_meeting(author, meeting_index_page)
elif author_type == "organization":
author_entity = create_organization(author, organization_index_page)
create_organization(author, organization_index_page)
elif author_type == "person":
author_entity = create_person(author, person_index_page)
create_person(author, person_index_page)
else:
logger.error(
f"Unknown author type for ID: { author['drupal_author_id'] }"
)

if author_entity is not None:
create_permanent_redirect(
redirect_path=author["url_path"],
redirect_entity=author_entity,
)


def handle_import_magazine_authors(file_name: str) -> None:
authors_list = parse_csv_file(file_name)
Expand Down

0 comments on commit c115196

Please sign in to comment.