def get_formatted_email(user):
 if (user == u'Administrator'):
  return user
 from email.utils import formataddr
 fullname = get_fullname(user)
 return formataddr((fullname, user))

def get_formatted_email ( user ) : if ( user == u'Administrator' ) : return user from email . utils import formataddr fullname = get_fullname ( user ) return formataddr ( ( fullname , user ) )
get email address of user formatted as: john doe <johndoe@example .