[CMF-checkins] CVS: CMF/CMFDefault - RegistrationTool.py:1.14

Andy McKay andy@agmweb.ca
Sat, 28 Sep 2002 14:33:28 -0400


Update of /cvs-repository/CMF/CMFDefault
In directory cvs.zope.org:/tmp/cvs-serv8726

Modified Files:
	RegistrationTool.py 
Log Message:
Check that when we send a password using mail_password_template, the To: field will actually be filled in. Otherwise we will get a bogus error msg.


=== CMF/CMFDefault/RegistrationTool.py 1.13 => 1.14 ===
--- CMF/CMFDefault/RegistrationTool.py:1.13	Sat Jun 29 11:01:55 2002
+++ CMF/CMFDefault/RegistrationTool.py	Sat Sep 28 14:33:28 2002
@@ -138,6 +138,11 @@
         if member is None:
             raise 'NotFound', 'The username you entered could not be found.'
     
+        # assert that we can actually get an email address, otherwise
+        # the template will be made with a blank To:, this is bad
+        if not member.getProperties('email'):
+            raise 'ValueError', 'That user does not have an email address.'
+        
         # Rather than have the template try to use the mailhost, we will
         # render the message ourselves and send it from here (where we
         # don't need to worry about 'UseMailHost' permissions).