mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-02-26 11:08:13 +00:00
ignore postcode areas in countries without postcodes properly
This commit is contained in:
@@ -234,10 +234,10 @@ def _update_postcode_areas(conn: Connection, analyzer: AbstractAnalyzer,
|
|||||||
country_code = cc
|
country_code = cc
|
||||||
fmt = matcher.get_matcher(country_code)
|
fmt = matcher.get_matcher(country_code)
|
||||||
pcs = []
|
pcs = []
|
||||||
assert fmt is not None
|
|
||||||
|
|
||||||
if (m := fmt.match(postcode)):
|
if fmt is not None:
|
||||||
pcs.append({'out': fmt.normalize(m), 'in': postcode})
|
if (m := fmt.match(postcode)):
|
||||||
|
pcs.append({'out': fmt.normalize(m), 'in': postcode})
|
||||||
|
|
||||||
if country_code is not None and pcs:
|
if country_code is not None and pcs:
|
||||||
_insert_postcode_areas(conn, country_code,
|
_insert_postcode_areas(conn, country_code,
|
||||||
|
|||||||
Reference in New Issue
Block a user