[CMF-checkins] CVS: CMF/CMFCore - RegistrationTool.py:1.13
Florent Guillaume
fg@nuxeo.com
Sat, 29 Jun 2002 11:02:25 -0400
Update of /cvs-repository/CMF/CMFCore
In directory cvs.zope.org:/tmp/cvs-serv4660/CMFCore
Modified Files:
RegistrationTool.py
Log Message:
Fixed CMFDefault.RegistrationTool to correctly check the lack of 'email'
property when creating a new member or when checking member's properties
validity (Tracker #508).
The fix ensures that the 'email' property is filled in at Join time, and
that a user is not allowed to clear his email (the policy in CMFDefault
seems to be that all members have an email).
I keep the possibility of a user leaving an already-empty password blank
when changing his preferences (for instance if it was removed by the
administrator for some reason, the user can still go change his other
properties).
=== CMF/CMFCore/RegistrationTool.py 1.12 => 1.13 ===
'''
if not self.isMemberIdAllowed(id):
- raise 'Bad Request', 'The login name you selected is already ' \
- 'in use or is not valid. Please choose another.'
-
+ raise ValueError('The login name you selected is already '
+ 'in use or is not valid. Please choose another.')
+
failMessage = self.testPasswordValidity(password)
if failMessage is not None:
- raise 'Bad Request', failMessage
+ raise ValueError(failMessage)
if properties is not None:
failMessage = self.testPropertiesValidity(properties)
-
if failMessage is not None:
- raise 'Bad Request', failMessage
+ raise ValueError(failMessage)
# Limit the granted roles.
# Anyone is always allowed to grant the 'Member' role.