Skip to content

Commit

Permalink
adds method to ignore postcodes in import scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
awdem committed Jul 16, 2024
1 parent 2ddb0db commit 026dd20
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions polling_stations/apps/data_importers/base_importers.py
Original file line number Diff line number Diff line change
Expand Up @@ -1005,6 +1005,14 @@ def should_ignore_uprns(self, record, *uprns_to_ignore):

return record_uprn in uprns_to_ignore

def should_ignore_postcode(self, record, postcodes_to_ignore):
record_postcode = (
getattr(record, self.residential_postcode_field)
.strip()
.replace("\xa0", " ")
)
return record_postcode in postcodes_to_ignore

def get_station_postcode(self, record):
return getattr(record, self.station_postcode_field).strip()

Expand Down

0 comments on commit 026dd20

Please sign in to comment.