Ignore:
Timestamp:
9 Jan 2023, 21:16:28 (22 months ago)
Author:
Henrik Bettermann
Message:

Specify the role in flash message after logging in.

Location:
main/waeup.kofa/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/CHANGES.txt

    r17253 r17261  
    441.7.2.dev0 (unreleased)
    55=======================
     6
     7* Specify the role in flash message after logging in.
    68
    79* Add `AccommodationViewer` role.
  • main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_browser.py

    r17018 r17261  
    689689        self.browser.getControl("Login").click()
    690690        self.assertTrue(
    691             'You logged in.' in self.browser.contents)
     691            'You logged in as an applicant.' in self.browser.contents)
    692692
    693693    def test_maintenance_mode(self):
     
    716716        self.login()
    717717        self.assertTrue(
    718             'You logged in.' in self.browser.contents)
     718            'You logged in as an applicant.' in self.browser.contents)
    719719        self.browser.open(self.edit_path)
    720720        self.assertTrue(self.browser.url != self.login_path)
     
    740740        self.login()
    741741        self.assertTrue(
    742             'You logged in.' in self.browser.contents)
     742            'You logged in as an applicant.' in self.browser.contents)
    743743        self.assertTrue(
    744744            '<strong>Congratulations!</strong> You have been offered provisional'
     
    20662066            '\nmsg: Dear John Anthony Tester,'
    20672067            '\nmsg: '
    2068             '\nmsg: Your application app2020_<6-DIGITS> has been successfully submitted to Sample University.'
     2068            '\nmsg: Your application app%s_<6-DIGITS> has been successfully submitted to Sample University.'
    20692069            '\nmsg: '
    20702070            '\nmsg: Regards'
    20712071            '\nmsg: '
    20722072            % (session_1, session_1, session_2, mandate_id_0,
    2073                session_1, session_1, session_2, mandate_id_1,),
     2073               session_1, session_1, session_2, mandate_id_1, session_1),
    20742074            self.get_fake_smtp_output()
    20752075            )
  • main/waeup.kofa/trunk/src/waeup/kofa/browser/pages.py

    r16834 r17261  
    366366        if SUBMIT is not None:
    367367            if self.request.principal.id != 'zope.anybody':
    368                 self.flash(_('You logged in.'))
     368                #self.flash(_('You logged in.'))
    369369                if self.request.principal.user_type == 'student':
     370                    self.flash(_('You logged in as a student.'))
    370371                    student = grok.getSite()['students'][
    371372                        self.request.principal.id]
     
    397398                    return
    398399                elif self.request.principal.user_type == 'applicant':
     400                    self.flash(_('You logged in as an applicant.'))
    399401                    container, application_number = self.request.principal.id.split('_')
    400402                    rel_link = '/applicants/%s/%s' % (
     
    406408                site_roles = get_user_account(self.request).roles
    407409                if local_roles.has_key('waeup.local.Lecturer'):
     410                    self.flash(_('You logged in as a lecturer.'))
    408411                    self.redirect(self.application_url() + '/my_courses')
    409412                    return
    410413                if local_roles.has_key('waeup.local.TranscriptOfficer') \
    411414                    or 'waeup.TranscriptOfficer' in site_roles:
     415                    self.flash(_('You logged in as a transcript officer.'))
    412416                    self.redirect(self.application_url() + '/my_transcript_requests')
    413417                    return
    414418                if local_roles.has_key('waeup.local.TranscriptSignee'):
     419                    self.flash(_('You logged in as a transcript signee.'))
    415420                    self.redirect(self.application_url() + '/my_transcript_signing_requests')
    416421                    return
    417422                if not self.camefrom:
     423                    self.flash(_('You logged in as an officer.'))
    418424                    self.redirect(self.application_url() + '/index')
    419425                    return
     426                self.flash(_('You logged in as an officer.'))
    420427                self.redirect(self.camefrom)
    421428                return
  • main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py

    r17176 r17261  
    32873287        self.browser.getControl("Login").click()
    32883288        self.assertTrue(
    3289             'You logged in.' in self.browser.contents)
     3289            'You logged in as a student.' in self.browser.contents)
    32903290        # Now students can add the current study level
    32913291        self.browser.getLink("Study Course").click()
     
    48374837        # lecturers can login and will be led to landing page.
    48384838        self.login_as_lecturer()
    4839         self.assertMatches('...You logged in...', self.browser.contents)
     4839        self.assertTrue(
     4840            'You logged in as a lecturer.' in self.browser.contents)
    48404841        self.assertEqual(self.browser.url, URL_LECTURER_LANDING)
    48414842        self.assertTrue(
     
    52135214        self.browser.getControl("Login").click()
    52145215        self.assertTrue(
    5215             'You logged in.' in self.browser.contents)
     5216            'You logged in as a student.' in self.browser.contents)
    52165217        self.assertTrue(
    52175218            '<a href="http://localhost/app/students/K1000000">Base Data</a>'
Note: See TracChangeset for help on using the changeset viewer.