From: Tony Mack Date: Fri, 5 Jan 2007 18:05:16 +0000 (+0000) Subject: - moved email notification code to Person class. call send_initiate_password_reset_em... X-Git-Tag: pycurl-7_13_1~166 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=a46f583cd7d2f24440eabf1bb7e7cd1e56fa6f22;p=plcapi.git - moved email notification code to Person class. call send_initiate_password_reset_email method instead --- diff --git a/PLC/Methods/InitiateResetPassword.py b/PLC/Methods/InitiateResetPassword.py index 1048669a..62769bc1 100644 --- a/PLC/Methods/InitiateResetPassword.py +++ b/PLC/Methods/InitiateResetPassword.py @@ -59,25 +59,8 @@ class InitiateResetPassword(Method): time.strftime("%Y-%m-%d %H:%M:%S", time.gmtime(time.time()+86400)) person.sync() - # email user next step instructions - to_addr = {} - to_addr[person['email']] = "%s %s" % \ - (person['first_name'], person['last_name']) - from_addr = {} - from_addr[self.api.config.PLC_MAIL_SUPPORT_ADDRESS] = \ - "%s %s" % ('Planetlab', 'Support') - messages = Messages(self.api, ['PASSWORD_RESET_INITIATE']) - if not messages: - raise PLCAPIError, "Email template not found" - message = messages[0] - subject = message['subject'] - template = message['template'] % \ - (self.api.config.PLC_WWW_HOST, - verification_key, person['person_id'], - self.api.config.PLC_MAIL_SUPPORT_ADDRESS, - self.api.config.PLC_WWW_HOST) - - self.api.mailer.mail(to_addr, None, from_addr, subject, template) + # send notification email + person.send_initiate_password_reset_email() # Logging variables self.object_ids = [person['person_id']]