Changeset 9709 for main


Ignore:
Timestamp:
22 Nov 2012, 20:47:52 (12 years ago)
Author:
Henrik Bettermann
Message:

Customize LoginPage?. Yesterday Uniben requested a feature to display suspended_comment when a deactivated student logs in. Today they want to remove this feature again. I leave the feature in the base package but customize it here.

Location:
main/waeup.uniben/trunk/src/waeup/uniben
Files:
4 edited

Legend:

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

    r8247 r9709  
    1818import grok
    1919from waeup.kofa.browser.pages import (
    20     SessionConfigurationAddFormPage, SessionConfigurationManageFormPage)
     20    SessionConfigurationAddFormPage, SessionConfigurationManageFormPage,
     21    LoginPage)
    2122from waeup.uniben.interfaces import (
    2223    ICustomSessionConfiguration, ICustomSessionConfigurationAdd)
     
    3132    """
    3233    form_fields = grok.AutoFields(ICustomSessionConfiguration)
     34
     35class CustomLoginPage(LoginPage):
     36
     37    def _comment(self, student):
     38        return None
  • main/waeup.uniben/trunk/src/waeup/uniben/locales/en/LC_MESSAGES/waeup.kofa.po

    r9447 r9709  
    1818msgstr "<strong>Notice:</strong> All student ids now start with 'B'. If your data have been migrated from the old portal just put 'B' in front of your old id. Your password has not changed.<br/><br/> Example: A123456 becomes BA123456  </br></br>The following ids are also  increased by one: A660679, A713978, A918093, B108215, B581313, B813281, C562575, C822243, D175969, E404483, E702275, E800008, F188239, F805950, F870881, F972478, H388222, H494715, H872022, H928836, K259461, K707682, K905447, K966006, L711372, M470637, M607029, N213198, N711778, P238823, P574469, P859084, Q584421, R490843, R685843, S612864, S869805, T108421, T381694, T382742, U105096, U125357, U527275, U812211, V356717, V660864, V960757, W200815, W248308, W366235, W979675, X138066, X157731, X686433, Y152186, Y375319 <br/><br/> Example: A660679 becomes BA660680 "
    1919
     20msgid "This message will be shown if and only if deactivated students try to login."
     21msgstr "This is a private comment the student can't see."
     22
  • main/waeup.uniben/trunk/src/waeup/uniben/students/tests/test_browser.py

    r9691 r9709  
    666666        self.assertEqual(self.student.state, 'courses registered')
    667667        return
     668
     669    def test_login(self):
     670        # If suspended_comment is set this message will be flashed instead
     671        self.student.suspended_comment = u'Aetsch baetsch!'
     672        self.student.suspended = True
     673        self.browser.open(self.login_path)
     674        self.browser.getControl(name="form.login").value = self.student_id
     675        self.browser.getControl(name="form.password").value = 'spwd'
     676        self.browser.getControl("Login").click()
     677        # Uniben does not display suspended_comment
     678        self.assertMatches(
     679            '...<div class="alert-message warning">Your account has been deactivated.</div>...',
     680            self.browser.contents)
     681        self.student.suspended = False
Note: See TracChangeset for help on using the changeset viewer.