Ignore:
Timestamp:
4 Apr 2012, 11:25:41 (13 years ago)
Author:
Henrik Bettermann
Message:

Use ChangePasswordRequestPage? also for applicants.

Change password requests require a registration number.

Location:
main/waeup.kofa/trunk/src/waeup/kofa/students
Files:
2 edited
1 moved

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/students/browser.py

    r7997 r8039  
    18511851    """
    18521852    grok.context(IUniversity)
    1853     grok.name('changepw')
     1853    grok.name('sendpw')
    18541854    grok.require('waeup.Anonymous')
    1855     grok.template('changepw')
    1856     label = _('Change my password')
     1855    grok.template('sendpassword')
     1856    label = _('Send me a new password')
    18571857    form_fields = grok.AutoFields(IStudentChangePassword)
    18581858
     
    18701870            # No need to flash something.
    18711871            return
    1872         # Search student
    1873         cat = queryUtility(ICatalog, name='students_catalog')
     1872        # Search student or applicant
    18741873        reg_number = data['reg_number']
    18751874        email = data['email']
     1875        cat = queryUtility(ICatalog, name='students_catalog')
    18761876        results = cat.searchResults(
    18771877            reg_number=(reg_number, reg_number),
    18781878            email=(email,email))
    18791879        if len(results) == 0:
    1880             self.flash(_('No student record found.'))
     1880            # Try also the applicants_catalog if no student record was found.
     1881            cat = queryUtility(ICatalog, name='applicants_catalog')
     1882            if cat is None:
     1883                self.flash(_('Application package not installed.'))
     1884                return
     1885            results = cat.searchResults(
     1886                reg_number=(reg_number, reg_number),
     1887                email=(email,email))
     1888        if len(results) == 0:
     1889            self.flash(_('No record found.'))
    18811890            return
    18821891        student = list(results)[0]
  • main/waeup.kofa/trunk/src/waeup/kofa/students/browser_templates/sendpassword.pt

    r8025 r8039  
    1717  </table>
    1818
     19  <p i18n:translate="email_address_problem">
     20    Enter the email address stored on Kofa.
     21    You can't change your email address here.
     22    If you've forgotten your email address or the email
     23    address stored in Kofa is wrong or no longer valid,
     24    use the enquiries form to request a change
     25    of address.
     26  </p>
     27  <br />
    1928  <div tal:condition="view/availableActions">
    2029    <input tal:repeat="action view/actions"
  • main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py

    r7997 r8039  
    16431643
    16441644    def test_change_password_request(self):
    1645         self.browser.open('http://localhost/app/changepw')
     1645        self.browser.open('http://localhost/app/sendpw')
    16461646        self.browser.getControl(name="form.reg_number").value = '123'
    16471647        self.browser.getControl(name="form.email").value = 'aa@aa.ng'
Note: See TracChangeset for help on using the changeset viewer.