X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=portal%2Fhomeview.py;h=45764319b81e6e2222e3a30085140077d8d5bdce;hb=5517f40e324b591c97ab6c01a337e029444da093;hp=029dc316778c293b927633b8b7c718743703c1fb;hpb=e8b8c02d51026521418ec98f641c8f14f790fda7;p=myslice.git diff --git a/portal/homeview.py b/portal/homeview.py index 029dc316..45764319 100644 --- a/portal/homeview.py +++ b/portal/homeview.py @@ -75,7 +75,7 @@ class HomeView (FreeAccessView, ThemeView): if 'myslice' in platform_detail['platform']: acc_auth_cred = account_config.get('delegated_authority_credentials','N/A') # assigning values - if acc_auth_cred == {}: + if acc_auth_cred=={} or acc_auth_cred=='N/A': pi = "is_not_pi" else: pi = "is_pi" @@ -101,6 +101,7 @@ class HomeView (FreeAccessView, ThemeView): ## check user is pi or not 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 platform_details = execute_query(self.request, platform_query) account_details = execute_query(self.request, account_query) for platform_detail in platform_details: @@ -111,7 +112,7 @@ class HomeView (FreeAccessView, ThemeView): if 'myslice' in platform_detail['platform']: acc_auth_cred = account_config.get('delegated_authority_credentials','N/A') # assigning values - if acc_auth_cred == {}: + if acc_auth_cred=={} or acc_auth_cred=='N/A': pi = "is_not_pi" else: pi = "is_pi"