7904: Fix place type for places without a main location
This commit is contained in:
parent
b67b060c8c
commit
9cc216ed2e
@ -161,7 +161,7 @@ def gramps_upgrade_17(self):
|
||||
else:
|
||||
placeref_list = []
|
||||
|
||||
type_num = 7 - level if name else 8
|
||||
type_num = 7 - level if name else PlaceType.UNKNOWN
|
||||
new_place = new_place[:5] + [placeref_list, name, [],
|
||||
PlaceType(type_num).serialize(), zip_code] + \
|
||||
new_place[6:12] + [[]] + new_place[12:]
|
||||
|
@ -61,7 +61,7 @@ class PlaceType(GrampsType):
|
||||
BUILDING = 19
|
||||
|
||||
_CUSTOM = CUSTOM
|
||||
_DEFAULT = COUNTRY
|
||||
_DEFAULT = UNKNOWN
|
||||
|
||||
_DATAMAP = [
|
||||
(UNKNOWN, _("Unknown"), "Unknown"),
|
||||
|
@ -1193,7 +1193,7 @@ class GrampsParser(UpdateCallback):
|
||||
break
|
||||
|
||||
self.placeobj.set_name(name)
|
||||
type_num = 7 - level if name else 8
|
||||
type_num = 7 - level if name else PlaceType.UNKNOWN
|
||||
self.placeobj.set_type(PlaceType(type_num))
|
||||
codes = [attrs.get('postal'), attrs.get('phone')]
|
||||
self.placeobj.set_code(' '.join(code for code in codes if code))
|
||||
|
@ -1698,7 +1698,7 @@ class PlaceParser(object):
|
||||
break
|
||||
|
||||
place.set_name(name)
|
||||
type_num = 7 - level if name else 8
|
||||
type_num = 7 - level if name else PlaceType.UNKNOWN
|
||||
place.set_type(PlaceType(type_num))
|
||||
code = loc.get_postal_code()
|
||||
place.set_code(code)
|
||||
|
Loading…
Reference in New Issue
Block a user