diff --git a/bin/migrate-oats-data/srw/submission/parcel/srw_parcel_init.py b/bin/migrate-oats-data/srw/submission/parcel/srw_parcel_init.py index e3902f0bb7..2e3e31aa6a 100644 --- a/bin/migrate-oats-data/srw/submission/parcel/srw_parcel_init.py +++ b/bin/migrate-oats-data/srw/submission/parcel/srw_parcel_init.py @@ -104,7 +104,7 @@ def _map_data(row, insert_index): "legal_description": row["legal_description"], "map_area_hectares": row["area_size"], "ownership_type_code": _map_ownership_type_code(row), - "pid": row["pid"], + "pid": str(row["pid"]).zfill(9) if row["pid"] is not None else None, "pin": row["pin"], "oats_subject_property_id": row["subject_property_id"], "oats_property_id": row["property_id"], diff --git a/bin/migrate-oats-data/srw/submission/primary_contact/srw_process_primary_contact.py b/bin/migrate-oats-data/srw/submission/primary_contact/srw_process_primary_contact.py index 858dffde2d..2fdddab4b8 100644 --- a/bin/migrate-oats-data/srw/submission/primary_contact/srw_process_primary_contact.py +++ b/bin/migrate-oats-data/srw/submission/primary_contact/srw_process_primary_contact.py @@ -135,6 +135,8 @@ def _get_name(row): first_name = row.get("first_name", None) middle_name = row.get("middle_name", None) - return " ".join( + result = " ".join( [name for name in (first_name, middle_name) if name is not None] ).strip() + + return None if result == "" else result diff --git a/bin/migrate-oats-data/srw/submission/transferee/srw_init_transferee.py b/bin/migrate-oats-data/srw/submission/transferee/srw_init_transferee.py index f323037bee..fe815109d0 100644 --- a/bin/migrate-oats-data/srw/submission/transferee/srw_init_transferee.py +++ b/bin/migrate-oats-data/srw/submission/transferee/srw_init_transferee.py @@ -145,10 +145,12 @@ def _get_name(row): first_name = row.get("first_name", None) middle_name = row.get("middle_name", None) - return " ".join( + result = " ".join( [name for name in (first_name, middle_name) if name is not None] ).strip() + return None if result == "" else result + def _map_owner_type(data): if data["organization_id"]: