X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=ui%2Ftopmenu.py;h=0c8d2257fa9c8d71e19c772639dbda7bd65f0c32;hb=f9f56dddbbfcc2e3a798e0f8920441b69264dc17;hp=0b022b520949728e00864ba317cc8ba61cbe30f0;hpb=f75124b277498b3d4ea090d8f6d59c681d6f4163;p=unfold.git diff --git a/ui/topmenu.py b/ui/topmenu.py index 0b022b52..0c8d2257 100644 --- a/ui/topmenu.py +++ b/ui/topmenu.py @@ -76,8 +76,11 @@ def topmenu_items_live (current, page): # We might use local storage instead # REGISTRY ONLY TO BE REMOVED WITH MANIFOLD-V2 - query_pi_auths = Query.get('myslice:user').filter_by('user_hrn', '==', '$user_hrn' ).select('user_hrn','pi_authorities') - page.enqueue_query(query_pi_auths) + if request.user.is_authenticated (): + query_pi_auths = Query.get('myslice:user').filter_by('user_hrn', '==', '$user_hrn' ).select('user_hrn','pi_authorities') + page.enqueue_query(query_pi_auths) + else: + query_pi_auths = Query() # # even though this plugin does not have any html materialization, the corresponding domid # # must exist because it is searched at init-time to create the JS plugin # # so we simply piggy-back the target button created in the topmenu