Changeset 8853 for main/waeup.kofa/trunk/src/waeup/kofa/students
- Timestamp:
- 29 Jun 2012, 17:28:06 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/students/browser.py
r8780 r8853 64 64 from waeup.kofa.hostels.hostel import NOT_OCCUPIED 65 65 from waeup.kofa.utils.helpers import get_current_principal, to_timezone 66 from waeup.kofa.mandates.mandate import StudentPasswordMandate 66 67 67 68 grok.context(IKofaObject) # Make IKofaObject the default context … … 1983 1984 kofa_utils = getUtility(IKofaUtils) 1984 1985 password = kofa_utils.genPassword() 1985 IUserAccount(student).setPassword(password) 1986 mandate = StudentPasswordMandate() 1987 mandate.params['password'] = password 1988 mandate.params['student_id'] = student.student_id 1989 site = grok.getSite() 1990 site['mandates'].addMandate(mandate) 1986 1991 # Send email with credentials 1987 login_url = self.url(grok.getSite(), 'login') 1992 args = {'mandate_id':mandate.mandate_id} 1993 mandate_url = self.url(site) + '/mandate?%s' % urlencode(args) 1994 url_info = u'Confirmation link: %s' % mandate_url 1988 1995 msg = _('You have successfully requested a password for the') 1989 1996 if kofa_utils.sendCredentials(IUserAccount(student), 1990 password, login_url, msg):1997 password, url_info, msg): 1991 1998 email_sent = student.email 1992 1999 else:
Note: See TracChangeset for help on using the changeset viewer.