1
0
mirror of https://github.com/Yubico/yubiadmin.git synced 2024-11-29 10:24:11 +01:00

Handle invalid URLs better.

This commit is contained in:
Dain Nilsson 2013-04-30 15:52:22 +02:00
parent d0eef01c52
commit d7f8586479
2 changed files with 8 additions and 1 deletions

View File

@ -266,7 +266,7 @@ class YubikeyVal(App):
else:
restart_daemon()
return self.redirect('/%s/syncpool' % self.name)
return self.redirect('/%s/synchronization' % self.name)
def ksms(self, request):
"""

View File

@ -25,6 +25,7 @@
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
from webob import exc
from webob.dec import wsgify
from yubiadmin.util.app import render
from yubiadmin.apps import apps
@ -66,10 +67,16 @@ class YubiAdmin(object):
if not module_name:
return render('index', modules=self.modules)
if not module_name in self.apps:
raise exc.HTTPNotFound
app, module = self.apps[module_name]
if not section_name:
section_name = module['sections'][0]['name']
if not hasattr(app, section_name):
raise exc.HTTPNotFound
section = next((section for section in module['sections']
if section['name'] == section_name), None)