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:
@@ -35,13 +35,14 @@ from TransUtils import sgettext as _
|
||||
# GRAMPS modules
|
||||
#
|
||||
#------------------------------------------------------------------------
|
||||
from gen.plug.docgen import FontStyle, ParagraphStyle, GraphicsStyle,\
|
||||
FONT_SANS_SERIF, PARA_ALIGN_CENTER
|
||||
from SubstKeywords import SubstKeywords
|
||||
from BasicUtils import name_displayer
|
||||
from Errors import ReportError
|
||||
from gen.plug import PluginManager
|
||||
from gen.plug.docgen import (FontStyle, ParagraphStyle, GraphicsStyle,
|
||||
FONT_SANS_SERIF, PARA_ALIGN_CENTER)
|
||||
from gen.plug.menu import BooleanOption, NumberOption, TextOption, PersonOption
|
||||
from ReportBase import Report, ReportUtils, CATEGORY_DRAW, MenuReportOptions
|
||||
from BasicUtils import name_displayer
|
||||
from SubstKeywords import SubstKeywords
|
||||
|
||||
pt2cm = ReportUtils.pt2cm
|
||||
|
||||
@@ -190,6 +191,8 @@ class AncestorTree(Report):
|
||||
|
||||
pid = menu.get_option_by_name('pid').get_value()
|
||||
center_person = database.get_person_from_gramps_id(pid)
|
||||
if (center_person == None) :
|
||||
raise ReportError(_("Person %s is not in the Database") % pid )
|
||||
|
||||
name = name_displayer.display_formal(center_person)
|
||||
self.title = _("Ancestor Graph for %s") % name
|
||||
|
||||
Reference in New Issue
Block a user