[Mpuls-commits] r998 - in wasko/branches/2.0: . waskaweb/controllers
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Thu Jan 28 19:36:38 CET 2010
Author: bh
Date: 2010-01-28 19:36:33 +0100 (Thu, 28 Jan 2010)
New Revision: 998
Modified:
wasko/branches/2.0/ChangeLog
wasko/branches/2.0/waskaweb/controllers/usersettings.py
Log:
* waskaweb/controllers/usersettings.py: Fix formatting.
Modified: wasko/branches/2.0/ChangeLog
===================================================================
--- wasko/branches/2.0/ChangeLog 2010-01-28 18:29:19 UTC (rev 997)
+++ wasko/branches/2.0/ChangeLog 2010-01-28 18:36:33 UTC (rev 998)
@@ -1,5 +1,9 @@
2010-01-28 Bernhard Herzog <bh at intevation.de>
+ * waskaweb/controllers/usersettings.py: Fix formatting.
+
+2010-01-28 Bernhard Herzog <bh at intevation.de>
+
* waskaweb/lib/navigation.py: Remove unused imports
2010-01-28 Bernhard Herzog <bh at intevation.de>
Modified: wasko/branches/2.0/waskaweb/controllers/usersettings.py
===================================================================
--- wasko/branches/2.0/waskaweb/controllers/usersettings.py 2010-01-28 18:29:19 UTC (rev 997)
+++ wasko/branches/2.0/waskaweb/controllers/usersettings.py 2010-01-28 18:36:33 UTC (rev 998)
@@ -1,27 +1,27 @@
# -*- coding: utf-8 -*-
#
# Copyright 2007, 2008 Intevation GmbH, Germany, <info at intevation.de>
-#
-# This file is part of mpuls WASKA (CoMPUter-based case fiLeS -
+#
+# This file is part of mpuls WASKA (CoMPUter-based case fiLeS -
# Web-Anwendungs-Server fuer Kompetenzagenturen).
-#
+#
# mpuls WASKA is free software: you can redistribute it and/or modify it under
# the terms of the GNU Affero General Public License as published by the
# Free Software Foundation, either version 3 of the License, or (at your
# option) any later version.
-#
+#
# mpuls WASKA is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
# License for more details.
-#
+#
# You should have received a copy of the GNU Affero General Public
# License along with mpuls WASKA. If not, see <http://www.gnu.org/licenses/>.
-#
-# mpuls WASKA has been developed on behalf of the
+#
+# mpuls WASKA has been developed on behalf of the
# Projekttraeger im Deutschen Zentrum fuer Luft- und Raumfahrt e.V. (PT-DLR)
# within the programme Kompetenzagenturen (Durchfuehrungsphase) funded by
-# the Bundesministerium fuer Familie, Senioren, Frauen und Jugend and
+# the Bundesministerium fuer Familie, Senioren, Frauen und Jugend and
# European Social Fund resources.
#
# Authors:
@@ -32,19 +32,26 @@
import logging
import formencode
-from waskaweb.lib.base import *
-from waskaweb.model.user import UserListObject, UserObject, SessionSuperAdmin, UserGroupList, UserGroup
-from waskaweb.lib.validators import BaseFormValidator, NewPasswordForm
-from waskaweb.lib.security import checkRole
+from waskaweb.lib.base import *
+from waskaweb.lib.validators import BaseFormValidator, NewPasswordForm
+from waskaweb.lib.security import checkRole
+from waskaweb.model.user import UserListObject, UserObject, SessionSuperAdmin, \
+ UserGroupList, UserGroup
+
+
log = logging.getLogger(__name__)
-SET_PASSWORD_NOTIFICATION_HEADER = u"""Benutzerpasswort geändert!"""
-SET_PASSWORD_NOTIFICATION_TEXT = u"""Ihr Passwort wurde erfolgreich geändert. Bitte klicken Sie auf "OK", um fortzufahren."""
-EDIT_STANDIN_SUCCESS_HEADER = _('adm_edit_standin_success_header')
-EDIT_STANDIN_SUCCESS_TEXT = _('adm_edit_standin_success_text')
+SET_PASSWORD_NOTIFICATION_HEADER = u"""Benutzerpasswort geändert!"""
+SET_PASSWORD_NOTIFICATION_TEXT = u"""\
+Ihr Passwort wurde erfolgreich geändert. Bitte klicken Sie auf "OK",
+um fortzufahren."""
+EDIT_STANDIN_SUCCESS_HEADER = _('adm_edit_standin_success_header')
+EDIT_STANDIN_SUCCESS_TEXT = _('adm_edit_standin_success_text')
+
+
class UsersettingsController(BaseController):
@checkRole(('admin_ka', 'cm_ka', 'pt_dlr', 'pb_ka'))
@@ -56,10 +63,10 @@
@checkRole(('admin_ka', 'cm_ka', 'pt_dlr', 'pb_ka'))
def showSettings(self, id):
- id = self._checkInt(id)
- c.uo = UserObject(id)
+ id = self._checkInt(id)
+ c.uo = UserObject(id)
c.vuo = UserGroup(c.uo.standin)
- return render('/usersettings/show_settings.mako')
+ return render('/usersettings/show_settings.mako')
@checkRole(('admin_ka', 'cm_ka', 'pt_dlr', 'pb_ka'))
def changePassword(self):
@@ -69,7 +76,7 @@
@checkRole(('admin_ka', 'cm_ka', 'pt_dlr', 'pb_ka'))
def changePasswordAction(self):
- validator = NewPasswordForm()
+ validator = NewPasswordForm()
try:
try:
uid = request.params['uid']
@@ -84,7 +91,8 @@
session.save()
c.success_for = SET_PASSWORD_NOTIFICATION_HEADER
c.success_text = SET_PASSWORD_NOTIFICATION_TEXT
- c.url_ok = h.url_for(controller="usersettings", action="showSettings", id=user.id)
+ c.url_ok = h.url_for(controller="usersettings",
+ action="showSettings", id=user.id)
else:
return "Password could not be changed"
except formencode.Invalid, error:
@@ -104,8 +112,8 @@
@checkRole(('admin_ka', 'cm_ka', 'pt_dlr', 'pb_ka'))
def changePasswordOnLoginAction(self):
# Do not forget to unset the flag for the need for pass change if this
- # action succseeds
- validator = NewPasswordForm()
+ # action succseeds
+ validator = NewPasswordForm()
try:
try:
form_result = validator.to_python(request.params)
@@ -115,12 +123,14 @@
# Save new password in the session
session_user = session['USER_AUTHORIZED']
session_user.password = new_pass
- session_user.needs_passrefresh = False
- session['USER_AUTHORIZED'] = session_user
+ session_user.needs_passrefresh = False
+ session['USER_AUTHORIZED'] = session_user
session.save()
c.success_for = SET_PASSWORD_NOTIFICATION_HEADER
c.success_text = SET_PASSWORD_NOTIFICATION_TEXT
- c.url_ok = h.url_for(controller="usersettings", action="showSettings", id=session_user.id)
+ c.url_ok = h.url_for(controller="usersettings",
+ action="showSettings",
+ id=session_user.id)
else:
return "Password could not be changed"
except formencode.Invalid, error:
@@ -133,18 +143,18 @@
@checkRole('cm_ka')
def editStandin(self, id):
- id = self._checkInt(id)
+ id = self._checkInt(id)
c.form_errors = {}
c.form_result = {}
- ulo = UserListObject()
- ug = UserGroupList()
- c.uo = UserObject(id)
- user = session['USER_AUTHORIZED']
+ ulo = UserListObject()
+ ug = UserGroupList()
+ c.uo = UserObject(id)
+ user = session['USER_AUTHORIZED']
# Get available users for standin. filter out admins and the current
# user
filter = [u.gid for u in ulo.getAdminList()]
filter.append(user.gid)
- c.grouplist = ug.getGroupList(filter)
+ c.grouplist = ug.getGroupList(filter)
return render('usersettings/edit_standin.mako')
@checkRole('cm_ka')
@@ -159,11 +169,11 @@
c.form_result = error.value
c.form_errors = error.error_dict or {}
return render('usersettings/edit_standin.mako')
- c.success_for = EDIT_STANDIN_SUCCESS_HEADER
- c.success_text = EDIT_STANDIN_SUCCESS_TEXT
- uid = c.form_result.get('uid')
- c.url_ok = "/usersettings/showSettings/%s" % (uid)
- return render ('/usersettings/dialogs/success_edit_standin.mako')
+ c.success_for = EDIT_STANDIN_SUCCESS_HEADER
+ c.success_text = EDIT_STANDIN_SUCCESS_TEXT
+ uid = c.form_result.get('uid')
+ c.url_ok = "/usersettings/showSettings/%s" % (uid)
+ return render ('/usersettings/dialogs/success_edit_standin.mako')
# return self.showSettings(c.form_result.get('uid'))
# vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8:
More information about the Mpuls-commits
mailing list