From: Loic Baron Date: Sat, 25 Apr 2015 09:40:41 +0000 (+0200) Subject: topmenu if user is not authenticated, when activate email for example X-Git-Tag: myslice-1.3~7 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;ds=sidebyside;h=d8e3f21a4163c7ad4198cf2c42eba7c3cadc829f;p=unfold.git topmenu if user is not authenticated, when activate email for example --- 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