~azzar1/unity/add-show-desktop-key

« back to all changes in this revision

Viewing changes to ivle/webapp/base/xhtml.py

  • Committer: William Grant
  • Date: 2009-07-05 06:51:21 UTC
  • mto: (1294.4.2 ui-the-third)
  • mto: This revision was merged to the branch mainline in revision 1353.
  • Revision ID: grantw@unimelb.edu.au-20090705065121-7rb399zi1abjh6yy
Don't crash if the ancestry can't be calculated; assume none instead.

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
from ivle.webapp.base.views import BaseView
29
29
from ivle.webapp.base.plugins import ViewPlugin, OverlayPlugin
30
30
from ivle.webapp.errors import HTTPError, Unauthorized
 
31
from ivle.webapp.routing import NoPath
31
32
 
32
33
class XHTMLView(BaseView):
33
34
    """
93
94
        ctx['app_template'] = app
94
95
        ctx['title_img'] = media_url(req, CorePlugin,
95
96
                                     "images/chrome/root-breadcrumb.png")
96
 
        ctx['ancestry'] = req.router.get_ancestors(self.context)
 
97
        try:
 
98
            ctx['ancestry'] = req.router.get_ancestors(self.context)
 
99
        except NoPath:
 
100
            ctx['ancestry'] = []
97
101
        ctx['breadcrumb_text'] = lambda x: x # TODO: Do it properly.
98
102
        ctx['url'] = req.router.generate
99
103
        self.populate_headings(req, ctx)