From d1bc327764fc13d114cef69371928430db3e56ea Mon Sep 17 00:00:00 2001 From: Doug Blank Date: Tue, 15 Jan 2008 18:34:09 +0000 Subject: [PATCH] * src/plugins/ImportCSV.py (CSVParser.process): fixed csv import with no surname (bug #1603) 2008-01-15 Douglas S. Blank svn: r9823 --- ChangeLog | 4 ++++ src/plugins/ImportCSV.py | 8 ++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index cab94f143..a46a8cb4e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2008-01-15 Douglas S. Blank + * src/plugins/ImportCSV.py (CSVParser.process): fixed csv import with no + surname (bug #1603) + 2008-01-15 Douglas S. Blank * src/plugins/DefaultGramplets.py (TopSurnamesGramplet.main): make clicking on data easier by clicking on entire line (bug #1594) diff --git a/src/plugins/ImportCSV.py b/src/plugins/ImportCSV.py index 000f26420..45beaaaca 100644 --- a/src/plugins/ImportCSV.py +++ b/src/plugins/ImportCSV.py @@ -425,13 +425,13 @@ class CSVParser: # if this person already exists, don't create them person = self.lookup("person", person_ref) if person == None: - if surname == None and firstname == "": - print "Error: need both firstname and surname for new person on line %d" % line_number - continue # need a name if it is a new person + if surname == None: + print "Warning: empty surname for new person on line %d" % line_number + surname = "" # new person person = self.create_person(firstname, surname) name = gen.lib.Name() - name.set_type( gen.lib.NameType(gen.lib.NameType.BIRTH)) + name.set_type(gen.lib.NameType(gen.lib.NameType.BIRTH)) name.set_first_name(firstname) name.set_surname(surname) person.set_primary_name(name)