5046: GEDCOM import fails on aka name

svn: r17839
This commit is contained in:
Michiel Nauta 2011-06-27 15:21:40 +00:00
parent 2b25ffec5b
commit 2bb51675ae
4 changed files with 9 additions and 4 deletions

View File

@ -123,7 +123,7 @@ class SurnameBase(object):
def get_primary_surname(self):
"""
Return the string of the surname that is the primary surname
Return the surname that is the primary surname
:returns: Returns the surname instance that
is the primary surname. If primary not set, and there is a surname,

View File

@ -3340,7 +3340,10 @@ class GedcomParser(UpdateCallback):
state.person.add_attribute(attr)
else:
name = gen.lib.Name()
name.set_surname(lname[-1].strip())
surname = gen.lib.Surname()
surname.set_surname(lname[-1].strip())
surname.set_primary()
name.set_surname_list([surname])
name.set_first_name(' '.join(lname[0:name_len-1]))
state.person.add_alternate_name(name)

View File

@ -108,7 +108,8 @@ class CalendarReport(Report):
name = Name(married_name)
else:
name = Name(primary_name)
name.set_surname(maiden_name)
surname_obj = name.get_primary_surname()
surname_obj.set_surname(maiden_name)
else:
name = Name(primary_name)
name.set_display_as(self.name_format)

View File

@ -1009,7 +1009,8 @@ class BasePage(object):
name = gen.lib.Name(married_name)
else:
name = gen.lib.Name(primary_name)
name.set_surname(maiden_name)
surname_obj = name.get_primary_surname()
surname_obj.set_surname(maiden_name)
else:
name = gen.lib.Name(primary_name)
name.set_display_as(name_format)