* src/GrampsDb/_GrampsDbBase.py: prevent null event types and
attribute types from being added * src/Editors/_EditAttribute.py: prevent null attribute types * src/Editors/_EditEvent.py: prevent null attribute types * src/AutoComp.py: filter out empty strings * src/ImgManip.py: check for file before attempting thumbnailer svn: r6898
This commit is contained in:
@@ -135,6 +135,14 @@ class EditAttribute(EditSecondary):
|
||||
Called when the OK button is pressed. Gets data from the
|
||||
form and updates the Attribute data structure.
|
||||
"""
|
||||
t = self.obj.get_type()
|
||||
|
||||
if t.is_custom() and str(t) == '':
|
||||
from QuestionDialog import ErrorDialog
|
||||
ErrorDialog(
|
||||
_("Cannot save attribute"),
|
||||
_("The attribute type cannot be empty"))
|
||||
return
|
||||
if self.callback:
|
||||
self.callback(self.obj)
|
||||
self.close()
|
||||
|
||||
@@ -204,6 +204,13 @@ class EditEvent(EditPrimary):
|
||||
"enter data or cancel the edit."))
|
||||
return
|
||||
|
||||
t = self.obj.get_type()
|
||||
if t.is_custom() and str(t) == '':
|
||||
ErrorDialog(
|
||||
_("Cannot save event"),
|
||||
_("The event type cannot be empty"))
|
||||
return
|
||||
|
||||
if self.obj.handle == None:
|
||||
trans = self.db.transaction_begin()
|
||||
self.db.add_event(self.obj,trans)
|
||||
|
||||
Reference in New Issue
Block a user