[Mpuls-commits] r1439 - wasko/branches/2.0/mpulsweb/controllers

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Wed Feb 10 10:57:39 CET 2010


Author: torsten
Date: 2010-02-10 10:57:38 +0100 (Wed, 10 Feb 2010)
New Revision: 1439

Modified:
   wasko/branches/2.0/mpulsweb/controllers/administration.py
Log:
* mpulsweb/controllers/administration.py
(AdministrationController.editUserAction): Copied from waskaweb.
Removed try/except block and adapted c-vars for dialogs.


Modified: wasko/branches/2.0/mpulsweb/controllers/administration.py
===================================================================
--- wasko/branches/2.0/mpulsweb/controllers/administration.py	2010-02-10 09:54:02 UTC (rev 1438)
+++ wasko/branches/2.0/mpulsweb/controllers/administration.py	2010-02-10 09:57:38 UTC (rev 1439)
@@ -15,6 +15,8 @@
 
 RESET_PASSWORD_CONFIRM = _('adm_reset_user_password')
 RESET_PASSWORD_CONFIRM_QUESTION = _('adm_reset_user_password_question')
+EDIT_USER_SUCCESS_HEADER = _('adm_edit_user_header')
+EDIT_USER_SUCCESS_TEXT = _('adm_edit_user_text')
 
 NEW_USERGROUP_SUCCESS_HEADER = _('adm_new_usergroup_success_header')
 NEW_USERGROUP_SUCCESS_TEXT = _('adm_new_usergroup_success_text')
@@ -87,6 +89,24 @@
         return render('/administration/edit_user.mako')
 
     @checkRole('admin_ka')
+    def editUserAction(self):
+        validator = EditUserForm()
+        try:
+            uid = request.params['uid']
+            c.uo = UserObject(uid)
+            form_result = validator.to_python(request.params)
+            c.uo.setData(form_result)
+            c.uo.store()
+            c.dialog_title = EDIT_USER_SUCCESS_HEADER
+            c.dialog_text = EDIT_USER_SUCCESS_TEXT
+            c.url_ok = "/administration/overviewUser"
+            return render('/administration/dialogs/success_edit_user.mako')
+        except formencode.Invalid, error:
+            c.form_result = error.value
+            c.form_errors = error.error_dict or {}
+            return render('/administration/edit_user.mako')
+
+    @checkRole('admin_ka')
     def resetUserPassword(self, id=None, confirmed='0'):
         id = self._checkInt(id)
         confirmed = self._checkBool(confirmed)



More information about the Mpuls-commits mailing list