app/soc/views/models/site.py
changeset 2189 8c9ab031a6b3
parent 2048 236f37777764
child 2210 1095b52ed667
--- a/app/soc/views/models/site.py	Wed Apr 15 19:13:52 2009 +0000
+++ b/app/soc/views/models/site.py	Wed Apr 15 23:21:40 2009 +0000
@@ -134,25 +134,22 @@
 
     entity = self._logic.getSingleton()
 
-    submenus = []
-
-    if entity:
-      submenus += document_view.view.getMenusForScope(entity, self._params)
+    submenus = document_view.view.getMenusForScope(entity, self._params)
 
-      try:
-        rights = self._params['rights']
-        rights.setCurrentUser(id, user)
-        rights.checkIsHost()
-        is_host = True
-      except out_of_band.Error:
-        is_host = False
+    try:
+      rights = self._params['rights']
+      rights.setCurrentUser(id, user)
+      rights.checkIsHost()
+      is_host = True
+    except out_of_band.Error:
+      is_host = False
 
-      if is_host:
-        submenus += [(redirects.getCreateDocumentRedirect(entity, 'site'),
-            "Create a New Document", 'any_access')]
+    if is_host:
+      submenus += [(redirects.getCreateDocumentRedirect(entity, 'site'),
+          "Create a New Document", 'any_access')]
 
-        submenus += [(redirects.getListDocumentsRedirect(entity, 'site'),
-            "List Documents", 'any_access')]
+      submenus += [(redirects.getListDocumentsRedirect(entity, 'site'),
+          "List Documents", 'any_access')]
 
     new_params = {}
     new_params['sidebar_additional'] = submenus