From 7e19fc4b81e6fb6dbb2f4655271b8839922929b5 Mon Sep 17 00:00:00 2001 From: Yasin Date: Wed, 24 Sep 2014 17:10:49 +0200 Subject: [PATCH] homeview: pi check- initialised variables --- portal/homeview.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/portal/homeview.py b/portal/homeview.py index 35037876..b0236525 100644 --- a/portal/homeview.py +++ b/portal/homeview.py @@ -69,6 +69,10 @@ class HomeView (FreeAccessView, ThemeView): activity.user.login(self.request) ## check user is pi or not + platform_details = {} + account_details = {} + acc_auth_cred = {} + acc_user_cred = {} platform_query = Query().get('local:platform').select('platform_id','platform','gateway_type','disabled') account_query = Query().get('local:account').select('user_id','platform_id','auth_type','config') platform_details = execute_query(self.request, platform_query) @@ -118,7 +122,12 @@ class HomeView (FreeAccessView, ThemeView): env = self.default_env() acc_auth_cred={} if request.user.is_authenticated(): + ## check user is pi or not + platform_details = {} + account_details = {} + acc_auth_cred = {} + acc_user_cred = {} platform_query = Query().get('local:platform').select('platform_id','platform','gateway_type','disabled') account_query = Query().get('local:account').select('user_id','platform_id','auth_type','config') # XXX Something like an invalid session seems to make the execute fail sometimes, and thus gives an error on the main page -- 2.43.0