move related imports as well
authorThierry Parmentelat <thierry.parmentelat@inria.fr>
Mon, 16 Dec 2013 11:27:47 +0000 (12:27 +0100)
committerThierry Parmentelat <thierry.parmentelat@inria.fr>
Mon, 16 Dec 2013 11:27:47 +0000 (12:27 +0100)
plugins/topmenuvalidation/__init__.py
ui/topmenu.py

index 6eafaf8..2006e79 100644 (file)
@@ -35,6 +35,10 @@ Query.get('ple:user').filter_by('user_hrn', '==', '$user_hrn').select('pi_author
         return [ 'query_uuid', 'button_domid', ]
 
 #################### here is an extract previously in topmenu.py
+#import json
+#from pprint import pprint
+#from manifold.manifoldapi       import execute_query
+#from manifold.core.query        import Query
 ###        # ** Where am I a PI **
 ###        # For this we need to ask SFA (of all authorities) = PI function
 ###        user_query  = Query().get('local:user').select('config','email')
index 82979d5..4680c21 100644 (file)
@@ -1,9 +1,12 @@
-import json
-from pprint import pprint
-from manifold.manifoldapi       import execute_query
-from manifold.core.query        import Query
 # a set of utilities to help make the global layout consistent across views
 
+def the_user (request):
+    "retrieves logged in user's email, or empty string"
+    if not request.user.is_authenticated (): 
+        return ''
+    else: 
+        return request.user.email
+
 # dropdowns are kind of ad hoc for now, and limited to one level
 # [ 
 # ### a regular first-level button
@@ -52,9 +55,3 @@ def topmenu_items (current,request=None):
                 for dd in d['contents']: mark_active(dd,d)
     return result
 
-def the_user (request):
-    "retrieves logged in user's email, or empty string"
-    if not request.user.is_authenticated (): 
-        return ''
-    else: 
-        return request.user.email