summaryrefslogtreecommitdiffstats
path: root/authentic/admin/settings.ptl
diff options
context:
space:
mode:
authorBenjamin Dauvergne <bdauvergne@entrouvert.com>2011-01-13 09:51:23 (GMT)
committerBenjamin Dauvergne <bdauvergne@entrouvert.com>2011-01-13 09:51:23 (GMT)
commitc73d4a292365201887074601881f52633516146e (patch)
tree8714035852b6178ea8fd746052670265aaf3bd99 /authentic/admin/settings.ptl
parentb52f66596f17b826a7ff72a90e93658212571327 (diff)
downloadauthentic-old-c73d4a292365201887074601881f52633516146e.zip
authentic-old-c73d4a292365201887074601881f52633516146e.tar.gz
authentic-old-c73d4a292365201887074601881f52633516146e.tar.bz2
[admin setting] catch invalid provider id and return 404
Diffstat (limited to 'authentic/admin/settings.ptl')
-rw-r--r--authentic/admin/settings.ptl15
1 files changed, 11 insertions, 4 deletions
diff --git a/authentic/admin/settings.ptl b/authentic/admin/settings.ptl
index 999cacb..cfbf2ef 100644
--- a/authentic/admin/settings.ptl
+++ b/authentic/admin/settings.ptl
@@ -20,6 +20,7 @@ from quixote import get_request, get_response, redirect, get_publisher, get_sess
from quixote.directory import Directory
from quixote.html import htmltext
from quixote.util import dump_request
+from quixote.errors import TraversalError
from qommon import get_cfg
@@ -463,13 +464,19 @@ class LibertyProviderUI(Directory):
_q_exports = ['', 'delete', 'edit', 'update_remote']
def __init__(self, component):
- self.lp = get_cfg('providers')[component]
+ try:
+ self.lp = get_cfg('providers')[component]
+ except KeyError:
+ raise TraversalError('%s does not exist' % component)
self.lpk = component
try:
- label = misc.get_provider_and_label(self.lpk)[1]
+ self.label = misc.get_provider_and_label(self.lpk)[1]
except KeyError:
- label = _('[Broken]')
- get_response().breadcrumb.append(('%s/' % self.lpk, label))
+ self.label = _('[Broken]')
+
+ def _q_traverse(self, path):
+ get_response().breadcrumb.append((('%s/' % self.lpk), self.label))
+ return Directory._q_traverse(self, path)
def _q_index [html] (self):
p, label = misc.get_provider_and_label(self.lpk)