Skip to content

Commit

Permalink
Fix: import script creates empty "husk" members
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew-Dickinson committed Oct 7, 2024
1 parent 3e0a0e3 commit 6ab44ca
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/meshdb/utils/spreadsheet_import/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,16 @@ def main():
building = get_or_create_building(row, addr_parser, dropped_modifications.append)
if not building:
skipped[row.id] = "Unable to parse address"
if (
not member.all_email_addresses
and not member.all_phone_numbers
and not member.name
and not member.notes
):
# If this member object stores no contact information, and is not going to be
# used for an install because of an invalid address, remove the member object
# to avoid cluttering the DB with "husk" members that are entirely blank
member.delete()
continue

node = get_or_create_node(row)
Expand Down

0 comments on commit 6ab44ca

Please sign in to comment.