git://git.onelab.eu
/
unfold.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
571de66
)
topmenu if user is not authenticated, when activate email for example
author
Loic Baron
<loic.baron@lip6.fr>
Sat, 25 Apr 2015 09:40:41 +0000
(11:40 +0200)
committer
Loic Baron
<loic.baron@lip6.fr>
Sat, 25 Apr 2015 09:40:41 +0000
(11:40 +0200)
ui/topmenu.py
patch
|
blob
|
history
diff --git
a/ui/topmenu.py
b/ui/topmenu.py
index
0b022b5
..
0c8d225
100644
(file)
--- 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
# 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
# # 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