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

scm-commit at wald.intevation.org scm-commit at wald.intevation.org
Thu Sep 27 17:58:34 CEST 2012


Author: torsten
Date: 2012-09-27 17:58:34 +0200 (Thu, 27 Sep 2012)
New Revision: 6077

Modified:
   base/trunk/mpulsweb/controllers/administration.py
Log:
Add logic to set responsibilty of fkz to users.


Modified: base/trunk/mpulsweb/controllers/administration.py
===================================================================
--- base/trunk/mpulsweb/controllers/administration.py	2012-09-27 15:57:05 UTC (rev 6076)
+++ base/trunk/mpulsweb/controllers/administration.py	2012-09-27 15:58:34 UTC (rev 6077)
@@ -48,6 +48,7 @@
     UserGroup, UserGroupFactory
 from mpulsweb.model.case import MpulsCaseOverview, MpulsCaseBundle
 from mpulsweb.model.phase import PhaseFactory 
+from mpulsweb.model.agency import MpulsAgencyOverview
 from mpulsweb.controllers.case_overview import default_phases
 
 log = logging.getLogger(__name__)
@@ -88,6 +89,10 @@
     def newUser(self):
         c.form_errors = {}
         c.form_result = {}
+        c.uo = UserObject()
+        agency_overview = MpulsAgencyOverview()
+        agency_overview.search('')
+        c.agency_list = agency_overview.getDatasets()
         return render('/administration/new_user.mako')
 
     @checkRole('admin')
@@ -100,6 +105,9 @@
             state.agency = agency
             c.form_result = validator.to_python(request.params, state)
             c.uo = UserObject()
+            agency_overview = MpulsAgencyOverview()
+            agency_overview.search('')
+            c.agency_list = agency_overview.getDatasets()
             # Set initial data which is needed to create a new user
             login = c.form_result.get('login', '')
             role = c.form_result.get('role', '')
@@ -120,6 +128,9 @@
         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()
         return render('/administration/show_user.mako')
 
     @checkRole('admin')
@@ -128,6 +139,9 @@
         c.form_errors = {}
         c.form_result = {}
         c.uo = UserObject(id)
+        agency_overview = MpulsAgencyOverview()
+        agency_overview.search('')
+        c.agency_list = agency_overview.getDatasets()
         return render('/administration/edit_user.mako')
 
     @checkRole('admin')
@@ -136,6 +150,9 @@
         try:
             uid = request.params['uid']
             c.uo = UserObject(uid)
+            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