0002542: Crash whilst generating web pages from command line
Throwing Report Error if center person is not in database. Added catching of Report Error to CommandLineReport if using GUI it is not possible to cause this, as you have to select a person that is in the DB. However on the command line you can specify any PID and even no person with that pid exists an error was thrown. svn: r13004
This commit is contained in:
@@ -37,11 +37,12 @@ from gettext import gettext as _
|
||||
# GRAMPS modules
|
||||
#
|
||||
#------------------------------------------------------------------------
|
||||
from gen.plug import PluginManager
|
||||
from gen.plug.menu import PersonOption, BooleanOption, NumberOption, \
|
||||
EnumeratedListOption
|
||||
from ReportBase import Report, ReportUtils, MenuReportOptions, CATEGORY_GRAPHVIZ
|
||||
from BasicUtils import name_displayer
|
||||
from Errors import ReportError
|
||||
from gen.plug import PluginManager
|
||||
from gen.plug.menu import (PersonOption, BooleanOption, NumberOption,
|
||||
EnumeratedListOption)
|
||||
from ReportBase import Report, ReportUtils, MenuReportOptions, CATEGORY_GRAPHVIZ
|
||||
import DateHandler
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
@@ -94,6 +95,8 @@ class HourGlassReport(Report):
|
||||
self.max_ascend = menu.get_option_by_name('maxascend').get_value()
|
||||
pid = menu.get_option_by_name('pid').get_value()
|
||||
self.center_person = database.get_person_from_gramps_id(pid)
|
||||
if (self.center_person == None) :
|
||||
raise ReportError(_("Person %s is not in the Database") % pid )
|
||||
self.colorize = menu.get_option_by_name('color').get_value()
|
||||
if self.colorize == 'colored':
|
||||
self.colors = colored
|
||||
|
||||
Reference in New Issue
Block a user