Ignore:
Timestamp:
28 Nov 2011, 21:42:28 (13 years ago)
Author:
Henrik Bettermann
Message:

Use new principal attributes in contact form pages (applicants not yet ready).

(And some missing things from last checkin).

File:
1 edited

Legend:

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

    r7230 r7234  
    375375    @grok.action('Send message now')
    376376    def send(self, *args, **data):
    377         useraccount = self.get_user_account
    378         if useraccount is None:
    379             self.flash("You don't have a user account.")
    380             return
    381         fullname = useraccount.title
    382         email_from = useraccount.email
    383         username = useraccount.name
     377        fullname = self.request.principal.title
     378        try:
     379            email_from = self.request.principal.email
     380        except AttributeError:
     381            email_from = self.config.email_admin
     382        username = self.request.principal.id
    384383        body = data['body']
    385384        #subject = u'Mail from SIRP'
Note: See TracChangeset for help on using the changeset viewer.