Changeset 7399 for main/waeup.sirp/trunk/src/waeup/sirp/applicants
- Timestamp:
- 20 Dec 2011, 07:39:33 (13 years ago)
- Location:
- main/waeup.sirp/trunk/src/waeup/sirp/applicants
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/applicants/browser.py
r7392 r7399 1059 1059 self.applyData(applicant, **data) 1060 1060 self.context.addApplicant(applicant) 1061 password = getUtility(ISIRPUtils).genPassword() 1061 sirp_utils = getUtility(ISIRPUtils) 1062 password = sirp_utils.genPassword() 1062 1063 IUserAccount(applicant).setPassword(password) 1063 1064 # Send email with credentials 1064 if self.sendCredentials(applicant, password): 1065 login_url = self.url(grok.getSite(), 'login') 1066 if sirp_utils.sendCredentials(applicant, password, login_url): 1065 1067 self.redirect(self.url(self.context, 'registration_complete', 1066 1068 data = dict(email=applicant.email))) … … 1069 1071 self.flash('Email could not been sent. Please retry later.') 1070 1072 return 1071 1072 def sendCredentials(self, applicant, password):1073 """Send credentials as email.1074 1075 Input is the applicant for which credentials are sent and the1076 password.1077 1078 Returns True or False to indicate successful operation.1079 """1080 sirp_utils = getUtility(ISIRPUtils)1081 username = applicant.applicant_id1082 fullname = applicant.display_fullname1083 subject = 'Your SIRP credentials'1084 msg = 'You have successfully been registered for the'1085 email_to = applicant.email1086 login_url = self.url(grok.getSite(), 'login')1087 success = sirp_utils.sendPassword(fullname,msg,username,1088 password,login_url,email_to,subject)1089 return success1090 1073 1091 1074 class ApplicantRegistrationEmailSent(SIRPPage): -
main/waeup.sirp/trunk/src/waeup/sirp/applicants/browser_templates/applicantregemailsent.pt
r7379 r7399 6 6 <p> 7 7 An email with your user name and password 8 has been sent to <span tal:replace="view/email">user@foo.baz</span> 8 has been sent to <span tal:replace="view/email">user@foo.baz</span>. 9 9 </p> 10 10 <p> … … 12 12 </p> 13 13 <p> 14 Thanks for using SIRP. 14 Thanks for using SIRP! 15 </p> 15 16 </div>
Note: See TracChangeset for help on using the changeset viewer.