From b38226fa0f2cfe582ff7d777a9f592952d55d359 Mon Sep 17 00:00:00 2001 From: Ferry Boender Date: Wed, 27 May 2015 18:05:41 +0200 Subject: [PATCH] Make checking for authorization the first thing we do. --- src/scriptform.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/scriptform.py b/src/scriptform.py index c434d30..05de06d 100755 --- a/src/scriptform.py +++ b/src/scriptform.py @@ -800,10 +800,10 @@ class ScriptFormWebApp(WebAppHandler): """ Render a list of available forms. """ - form_config = self.scriptform.get_form_config() if not self.auth(): return + form_config = self.scriptform.get_form_config() h_form_list = [] for form_def in form_config.get_visible_forms(getattr(self, 'username', None)): h_form_list.append(u''' @@ -833,11 +833,10 @@ class ScriptFormWebApp(WebAppHandler): """ Render a form. """ - - form_config = self.scriptform.get_form_config() if not self.auth(): return + form_config = self.scriptform.get_form_config() fr = FormRender(None) def render_field(field, errors): @@ -923,10 +922,10 @@ class ScriptFormWebApp(WebAppHandler): a callback to a script. How the output is handled depends on settings in the form definition. """ - form_config = self.scriptform.get_form_config() if not self.auth(): return + form_config = self.scriptform.get_form_config() form_name = form_values.getfirst('form_name', None) form_def = form_config.get_form_def(form_name) if form_def.allowed_users is not None and \