Changeset 9705


Ignore:
Timestamp:
21 Nov 2012, 20:54:11 (12 years ago)
Author:
Henrik Bettermann
Message:

If suspended_comment is set this message will be flashed instead.

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

Legend:

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

    r9701 r9705  
    259259                        return
    260260                    # Now we know that the student is suspended.
    261                     self.flash(_('Your account has been deactivated.'))
     261                    comment = getattr(student, 'suspended_comment', None)
     262                    if comment:
     263                        self.flash(comment)
     264                    else:
     265                        self.flash(_('Your account has been deactivated.'))
    262266                    return
    263267            self.flash(_('You entered invalid credentials.'))
  • main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py

    r9690 r9705  
    17901790        self.browser.getControl("Login").click()
    17911791        self.assertMatches(
    1792             '...Your account has been deactivated...', self.browser.contents)
     1792            '...<div class="alert-message warning">'
     1793            'Your account has been deactivated.</div>...', self.browser.contents)
     1794        # If suspended_comment is set this message will be flashed instead
     1795        self.student.suspended_comment = u'Aetsch baetsch!'
     1796        self.browser.getControl(name="form.login").value = self.student_id
     1797        self.browser.getControl(name="form.password").value = 'spwd'
     1798        self.browser.getControl("Login").click()
     1799        self.assertMatches(
     1800            '...<div class="alert-message warning">Aetsch baetsch!</div>...',
     1801            self.browser.contents)
    17931802        self.student.suspended = False
    17941803        # Students can't login if a temporary password has been set and
Note: See TracChangeset for help on using the changeset viewer.