From 02f5e128cc9ff84c89dcd618cd70896a7d2ed9ec Mon Sep 17 00:00:00 2001 From: Ferry Boender Date: Fri, 3 Apr 2015 17:37:53 +0200 Subject: [PATCH] If only one form is defined, go directly to that form from the index. Otherwise, show the list of defined forms. --- src/scriptform.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/scriptform.py b/src/scriptform.py index 6be3464..4209733 100755 --- a/src/scriptform.py +++ b/src/scriptform.py @@ -506,7 +506,12 @@ class ScriptFormWebApp(WebAppHandler): This class is a request handler for WebSrv. """ def index(self): - return self.h_list() + form_config = self.scriptform.get_form_config() + if len(form_config.forms) == 1: + first_form = form_config.forms[0] + return self.h_form(first_form.name) + else: + return self.h_list() def auth(self): """