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

Specify the role in flash message after logging in.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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
Note: See TracChangeset for help on using the changeset viewer.