Skip to content

Commit fec65cf

Browse files
committed
Fixed bug in municipality and postcode lookups for addr entries
1 parent b8e6697 commit fec65cf

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/iceaddr/addresses.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@
2222
def _add_postcode_info(addr: Dict[str, Any]) -> Dict[str, Any]:
2323
"""Look up postcode info, add keys to address dictionary."""
2424
pn = addr.get("postnr")
25-
if pn and POSTCODES.get(pn):
25+
if pn is not None and POSTCODES.get(pn):
2626
addr.update(POSTCODES[pn])
2727
return addr
2828

2929
def _add_municipality_info(addr: Dict[str, Any]) -> Dict[str, Any]:
3030
"""Look up municipality info, add keys to address dictionary."""
3131
mn = addr.get("svfnr")
32-
if mn and MUNICIPALITIES.get(mn):
32+
if mn is not None and MUNICIPALITIES.get(mn):
3333
addr["svfheiti"] = MUNICIPALITIES[mn]
3434
return addr
3535

src/iceaddr/db.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"""
1111

1212
import sqlite3
13+
1314
from pkg_resources import resource_filename
1415

1516
_DB_REL_PATH = "iceaddr.db"

0 commit comments

Comments
 (0)