Skip to content

Commit

Permalink
Fixed empty ADDR in Gedcom export
Browse files Browse the repository at this point in the history
  • Loading branch information
JeroenVanOort committed Nov 13, 2023
1 parent 892fc27 commit 224b852
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions gramps/plugins/export/exportgedcom.py
Original file line number Diff line number Diff line change
Expand Up @@ -1610,7 +1610,7 @@ def _place(self, place, dateobj, level):
country = location.get(PlaceType.COUNTRY)
postal_code = place.get_code()

if street or locality or city or state or postal_code or country:
if street:
self._writeln(level, "ADDR", street)
if street:
self._writeln(level + 1, "ADR1", street)
Expand Down Expand Up @@ -1652,14 +1652,7 @@ def __write_addr(self, level, addr):
@param addr: The location or address
@type addr: [a super-type of] LocationBase
"""
if (
addr.get_street()
or addr.get_locality()
or addr.get_city()
or addr.get_state()
or addr.get_postal_code()
or addr.get_country()
):
if (addr.get_street()):
self._writeln(level, "ADDR", addr.get_street())
if addr.get_locality():
self._writeln(level + 1, "CONT", addr.get_locality())
Expand All @@ -1672,8 +1665,7 @@ def __write_addr(self, level, addr):
if addr.get_country():
self._writeln(level + 1, "CONT", addr.get_country())

if addr.get_street():
self._writeln(level + 1, "ADR1", addr.get_street())
self._writeln(level + 1, "ADR1", addr.get_street())
if addr.get_locality():
self._writeln(level + 1, "ADR2", addr.get_locality())
if addr.get_city():
Expand Down

0 comments on commit 224b852

Please sign in to comment.