From: Yasin Date: Wed, 24 Sep 2014 15:10:49 +0000 (+0200) Subject: homeview: pi check- initialised variables X-Git-Tag: myslice-1.2~1^2~25 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=7e19fc4b81e6fb6dbb2f4655271b8839922929b5;hp=c93e8552cd6d1c3e3103e8e8a062d0ff434200dd;p=myslice.git homeview: pi check- initialised variables --- 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