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 May 28, 2024
1 parent 276fa6a commit a1639a1
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 @@ -1004,6 +1004,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


class BaseShpStationsCsvAddressesImporter(
BaseStationsAddressesImporter, CsvMixin, ShpMixin
Expand Down

0 comments on commit a1639a1

Please sign in to comment.