warn rather than error out on duplicate fields

This commit is contained in:
Damien Elmes 2012-09-06 03:54:58 +09:00
parent f90806277e
commit a1b359d4ef

View file

@ -129,9 +129,10 @@ class AddCards(QDialog):
def addNote(self, note): def addNote(self, note):
note.model()['did'] = self.deckChooser.selectedId() note.model()['did'] = self.deckChooser.selectedId()
if note.dupeOrEmpty(): ret = note.dupeOrEmpty()
if ret == 1:
showWarning(_( showWarning(_(
"The first field is empty or not unique."), "The first field is empty."),
help="AddItems#AddError") help="AddItems#AddError")
return return
cards = self.mw.col.addNote(note) cards = self.mw.col.addNote(note)