[Mpuls-commits] r2987 - in base/trunk: . mpulsweb/controllers
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Thu Jun 10 15:45:34 CEST 2010
Author: bh
Date: 2010-06-10 15:45:33 +0200 (Thu, 10 Jun 2010)
New Revision: 2987
Modified:
base/trunk/ChangeLog
base/trunk/mpulsweb/controllers/administration.py
Log:
* mpulsweb/controllers/administration.py: Fix formatting.
Modified: base/trunk/ChangeLog
===================================================================
--- base/trunk/ChangeLog 2010-06-10 11:18:37 UTC (rev 2986)
+++ base/trunk/ChangeLog 2010-06-10 13:45:33 UTC (rev 2987)
@@ -1,5 +1,9 @@
2010-06-10 Bernhard Herzog <bh at intevation.de>
+ * mpulsweb/controllers/administration.py: Fix formatting.
+
+2010-06-10 Bernhard Herzog <bh at intevation.de>
+
* mpulsweb/lib/translation.py: Import LanguageError too.
2010-06-10 Torsten Irländer <torsten.irlaender at intevation.de>
Modified: base/trunk/mpulsweb/controllers/administration.py
===================================================================
--- base/trunk/mpulsweb/controllers/administration.py 2010-06-10 11:18:37 UTC (rev 2986)
+++ base/trunk/mpulsweb/controllers/administration.py 2010-06-10 13:45:33 UTC (rev 2987)
@@ -15,7 +15,7 @@
from mpulsweb.model.user import UserListObject, UserObject, UserGroupList, \
UserGroup, UserGroupFactory
from mpulsweb.model.case import MpulsCaseOverview, MpulsCaseBundle
-from mpulsweb.controllers.case_overview import default_phases
+from mpulsweb.controllers.case_overview import default_phases
RESET_PASSWORD_CONFIRM = _('adm_reset_user_password')
@@ -79,7 +79,6 @@
class AdministrationController(BaseController):
-
@checkRole('admin_ka')
def index(self):
return self.overviewUser()
@@ -261,7 +260,8 @@
c.success_text = DELETE_USER_SUCCESS_TEXT
c.url_ok = url_for(controller='/administration',
action='overviewUser')
- return render('/administration/dialogs/success_delete_user.mako')
+ return render('/administration/dialogs/'
+ 'success_delete_user.mako')
else:
c.context = "../main.mako"
@@ -285,32 +285,35 @@
if 'editor' in request.params:
try:
- data = formencode.variabledecode.variable_decode(request.params)
+ data = formencode.variabledecode.variable_decode(request.params)
form_result = validator.to_python(data)
case_bundle = MpulsCaseBundle(form_result.get('case_id', []))
- new_editor = UserObject(form_result.get('editor'))
- del_user = UserObject(form_result.get('user_id'))
- all_cases.search('editor:%s;state:1;state:2;state:3;state:4;state:5'
- % del_user.id)
- num = case_bundle.setEditor(form_result.get('editor'))
+ new_editor = UserObject(form_result.get('editor'))
+ del_user = UserObject(form_result.get('user_id'))
+ all_cases.search('editor:%s;state:1;state:2;state:3;state:4;'
+ 'state:5' % del_user.id)
+ num = case_bundle.setEditor(form_result.get('editor'))
rest = all_cases.numDatasets() - case_bundle.numDatasets()
c.url_ok = url_for(controller='/administration',
action='deleteUser',
id=form_result.get('user_id'), confirmed=1)
c.success_for = SETEDITOR_NOTIFICATION_SUCCESS_HEAD
if rest > 0:
- c.success_for = SETEDITOR_NOTIFICATION_SUCCESS_REST_HEAD
+ c.success_for = SETEDITOR_NOTIFICATION_SUCCESS_REST_HEAD
c.success_text = (SETEDITOR_NOTIFICATION_SUCCESS_REST
- % (new_editor.first_name,
- new_editor.last_name,
- del_user.first_name, del_user.last_name))
+ % (new_editor.first_name,
+ new_editor.last_name,
+ del_user.first_name,
+ del_user.last_name))
else:
- c.success_for = SETEDITOR_NOTIFICATION_SUCCESS_HEAD
+ c.success_for = SETEDITOR_NOTIFICATION_SUCCESS_HEAD
c.success_text = (SETEDITOR_NOTIFICATION_SUCCESS
- % (new_editor.first_name,
- new_editor.last_name,
- del_user.first_name, del_user.last_name))
- return render('/administration/dialogs/notificate_delete_user_helper.mako')
+ % (new_editor.first_name,
+ new_editor.last_name,
+ del_user.first_name,
+ del_user.last_name))
+ return render('/administration/dialogs/'
+ 'notificate_delete_user_helper.mako')
except formencode.Invalid, error:
return self.deleteUser(form_result.get('user_id'), '1')
else:
@@ -350,9 +353,9 @@
c.form_errors = error.error_dict or {}
form = render('/administration/new_usergroup.mako')
return formencode.htmlfill.render(form,
- c.form_result,
- c.form_errors,
- auto_insert_errors=False)
+ c.form_result,
+ c.form_errors,
+ auto_insert_errors=False)
except Exception, e:
log.exception(e)
c.dialog_title = NEW_USERGROUP_FAILURE_HEADER
@@ -387,9 +390,8 @@
c.userlist = userlist.getUserList(filter=[u.id for u in admins])
form = render('/administration/edit_usergroup.mako')
return formencode.htmlfill.render(form,
- c.form_result,
- c.form_errors,
- auto_insert_errors=False)
+ c.form_result, c.form_errors,
+ auto_insert_errors=False)
@checkRole('admin_ka')
def editUserGroupAction(self):
@@ -420,9 +422,8 @@
c.form_errors = error.error_dict or {}
form = render('/administration/edit_usergroup.mako')
return formencode.htmlfill.render(form,
- c.form_result,
- c.form_errors,
- auto_insert_errors=False)
+ c.form_result, c.form_errors,
+ auto_insert_errors=False)
@checkRole('admin_ka')
def deleteUserGroup(self, id, confirmed='0'):
@@ -437,7 +438,8 @@
c.dialog_text = DELETE_USERGROUP_SUCCESS_TEXT
c.url_ok = url_for(controller='/administration',
action='overviewUserGroups')
- return render('/administration/dialogs/success_deletegroup_user.mako')
+ return render('/administration/dialogs/'
+ 'success_deletegroup_user.mako')
else:
c.context = "../main.mako"
c.dialog_title = DELETE_USERGROUP_CONFIRM
@@ -447,7 +449,8 @@
confirmed=1)
c.url_no = url_for(controller='/administration',
action='overviewUserGroups')
- return render('/administration/dialogs/confirm_deleteusergroup.mako')
+ return render('/administration/dialogs/'
+ 'confirm_deleteusergroup.mako')
except Exception, e:
log.exception(e)
c.dialog_title = DELETE_USERGROUP_FAILED_HEADER
More information about the Mpuls-commits
mailing list