Skip to content

Commit

Permalink
Seperated first and last name for Person export
Browse files Browse the repository at this point in the history
  • Loading branch information
david-okeke1337 committed Dec 17, 2024
1 parent 1a5ce21 commit db02c62
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
3 changes: 2 additions & 1 deletion src/search/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,8 @@ def get_page_export_row(page_result: "BasePage", request: HttpRequest) -> list[s

def get_person_export_row(person_result: "Person", request: HttpRequest) -> list[str]:
return [
f"{person_result.first_name} {person_result.last_name}",
person_result.first_name,
person_result.last_name,
person_result.email,
person_result.primary_phone_number,
request.build_absolute_uri(person_result.get_absolute_url()),
Expand Down
25 changes: 13 additions & 12 deletions src/search/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,29 +166,30 @@ def export_search(request: HttpRequest, category: str) -> HttpResponse:
"header": [
"Title",
"URL",
"Edit-URL",
"Content-Owner-Name",
"Content-Owner-Email",
"Content-Author-Name",
"Content-Author-Email",
"First-Published",
"Last-Updated",
"Page-Type",
"Edit URL",
"Content Owner Name",
"Content Owner Email",
"Content Author Name",
"Content Author Email",
"First Published",
"Last Updated",
"Page Type",
],
"item_to_row_function": get_page_export_row,
},
Person: {
"header": [
"Name",
"First Name",
"Last Name",
"Email",
"Phone",
"Profile-URL",
"Roles{'Job-Title':'Team-Name'}",
"Profile URL",
"Roles {'Job Title': 'Team Name'}",
],
"item_to_row_function": get_person_export_row,
},
Team: {
"header": ["Title", "URL", "Edit-URL"],
"header": ["Title", "URL", "Edit URL"],
"item_to_row_function": get_team_export_row,
},
}
Expand Down

0 comments on commit db02c62

Please sign in to comment.