4383: Error while attempt to edit family

2521: Problem with erroneous birth date in using the family editor.
We show validation error on date > next year, and don't crash on large year anymore



svn: r16468
This commit is contained in:
Benny Malengier
2011-01-25 12:45:49 +00:00
parent db30ca661f
commit c2e353a72b
3 changed files with 31 additions and 6 deletions

View File

@@ -62,7 +62,7 @@ import gtk
#
#-------------------------------------------------------------------------
from gen.ggettext import sgettext as _
from gen.lib import Date
from gen.lib.date import Date, NextYear
import DateHandler
import const
import GrampsDisplay
@@ -150,6 +150,9 @@ class DateEdit(object):
# if text could not be parsed it is assumed invalid
if self.date_obj.get_modifier() == Date.MOD_TEXTONLY:
return ValidationError(_('Bad Date'))
elif (self.date_obj.to_calendar(calendar_name=Date.CAL_GREGORIAN) >
NextYear()):
return ValidationError(_('Date more than one year in the future'))
def invoke_date_editor(self, obj):
"""