[Mpuls-commits] r6109 - base/trunk/mpulsweb/controllers

scm-commit at wald.intevation.org scm-commit at wald.intevation.org
Wed Oct 10 16:09:21 CEST 2012


Author: torsten
Date: 2012-10-10 16:09:21 +0200 (Wed, 10 Oct 2012)
New Revision: 6109

Modified:
   base/trunk/mpulsweb/controllers/administration.py
Log:
Only load agency overview if evaluation server is enabled


Modified: base/trunk/mpulsweb/controllers/administration.py
===================================================================
--- base/trunk/mpulsweb/controllers/administration.py	2012-10-09 15:07:42 UTC (rev 6108)
+++ base/trunk/mpulsweb/controllers/administration.py	2012-10-10 14:09:21 UTC (rev 6109)
@@ -134,9 +134,11 @@
         id = self._checkInt(id)
         c.uo = UserObject(id)
         c.vuo = UserGroup(c.uo.standin)
-        agency_overview = MpulsAgencyOverview()
-        agency_overview.search('')
-        c.agency_list = agency_overview.getDatasets()
+        # Load the agency list if application is running as evaluation server
+        if g.mpuls_config.is_enabled('module', 'agency-overview'):
+            agency_overview = MpulsAgencyOverview()
+            agency_overview.search('')
+            c.agency_list = agency_overview.getDatasets()
         return render('/administration/show_user.mako')
 
     @checkRole('admin')
@@ -145,9 +147,11 @@
         c.form_errors = {}
         c.form_result = {}
         c.uo = UserObject(id)
-        agency_overview = MpulsAgencyOverview()
-        agency_overview.search('')
-        c.agency_list = agency_overview.getDatasets()
+        # Load the agency list if application is running as evaluation server
+        if g.mpuls_config.is_enabled('module', 'agency-overview'):
+            agency_overview = MpulsAgencyOverview()
+            agency_overview.search('')
+            c.agency_list = agency_overview.getDatasets()
         return render('/administration/edit_user.mako')
 
     @checkRole('admin')
@@ -156,9 +160,11 @@
         try:
             uid = request.params['uid']
             c.uo = UserObject(uid)
-            agency_overview = MpulsAgencyOverview()
-            agency_overview.search('')
-            c.agency_list = agency_overview.getDatasets()
+            # Load the agency list if application is running as evaluation server
+            if g.mpuls_config.is_enabled('module', 'agency-overview'):
+                agency_overview = MpulsAgencyOverview()
+                agency_overview.search('')
+                c.agency_list = agency_overview.getDatasets()
             form_result = validator.to_python(request.params)
             c.uo.setData(form_result)
             c.uo.store()



More information about the Mpuls-commits mailing list