Changeset 1356 in products


Ignore:
Timestamp:
Oct 25, 2009 9:26:59 PM (10 years ago)
Author:
jcbrand
Message:

Show users full name in emails

File:
1 edited

Legend:

Unmodified
Added
Removed
  • qPloneComments/branches/jcbrand-abuseFeature/utils.py

    r1161 r1356  
    7373 
    7474def send_email(reply, context, state): 
     75    mtool = getToolByName(context, 'portal_membership') 
    7576    def getEmail(obj, context): 
    7677        email = obj.getProperty('email', None) 
     
    7879            creators = hasattr(obj, 'listCreators') and obj.listCreators() or [obj.Creator(),] 
    7980            userid = creators and creators[0] or "" 
    80             creator = getToolByName(context, 'portal_membership').getMemberById(userid) 
     81            creator = mtool.getMemberById(userid) 
    8182            if creator and allowEmail(context, reply, state, creator): 
    8283                return creator.getProperty('email', '') 
     
    9798    def getParentOwnerEmail(reply, context): 
    9899        creator_id = getParent(reply).getOwnerTuple()[1] 
    99         creator = getToolByName(context, 'portal_membership').getMemberById(creator_id) 
     100        creator = mtool.getMemberById(creator_id) 
    100101        if creator and allowEmail(context, reply, state, creator): 
    101102            return creator.getProperty('email', '') 
     
    109110    organization_name = getProp(context, 'email_subject_prefix', '') 
    110111    creator_name = reply.getOwnerTuple()[1] 
     112    creator = mtool.getMemberById(creator_name) 
     113    if creator is not None: 
     114        creator_name = creator.getProperty('fullname', creator_name) 
    111115    admin_email = context.portal_url.getPortalObject().getProperty('email_from_address') 
    112116 
Note: See TracChangeset for help on using the changeset viewer.