diff --git a/pycvsanaly2/DBContentHandler.py b/pycvsanaly2/DBContentHandler.py index 15bf0a2..e8f8bf5 100644 --- a/pycvsanaly2/DBContentHandler.py +++ b/pycvsanaly2/DBContentHandler.py @@ -201,8 +201,14 @@ def ensure_person(person): name = to_utf8(person.name) email = person.email - cursor.execute(statement("SELECT id from people where name = ? and email = ?", + + if not email: + cursor.execute(statement("SELECT id from people where name = ? and email IS NULL", + self.db.place_holder), (name,)) + else: + cursor.execute(statement("SELECT id from people where name = ? and email = ?", self.db.place_holder), (name, email)) + rs = cursor.fetchone() if not rs: p = DBPerson(None, person)