diff options
| author | Barry Warsaw | 2016-03-23 16:01:10 -0400 |
|---|---|---|
| committer | Barry Warsaw | 2016-03-23 16:01:10 -0400 |
| commit | ab2b619db5f3de47cffc2740901c4f82958a7d96 (patch) | |
| tree | bb62420bd04ebe829d91fdb4a0f0ac06344673b5 /src/mailman/app/notifications.py | |
| parent | 63fcaa68c99a0398002c1a1a752754483fa0b757 (diff) | |
| download | mailman-ab2b619db5f3de47cffc2740901c4f82958a7d96.tar.gz mailman-ab2b619db5f3de47cffc2740901c4f82958a7d96.tar.zst mailman-ab2b619db5f3de47cffc2740901c4f82958a7d96.zip | |
Diffstat (limited to 'src/mailman/app/notifications.py')
| -rw-r--r-- | src/mailman/app/notifications.py | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/mailman/app/notifications.py b/src/mailman/app/notifications.py index b20cc6432..e28714eb5 100644 --- a/src/mailman/app/notifications.py +++ b/src/mailman/app/notifications.py @@ -76,14 +76,19 @@ def send_welcome_message(mlist, member, language, text=''): """ welcome_message = _get_message(mlist.welcome_message_uri, mlist, language) options_url = member.options_url - # Get the text from the template. + # Try to find a non-empty display name. We first look at the directly + # subscribed record, which will either be the address or the user. That's + # handled automatically by going through member.subscriber. If that + # doesn't give us something useful, try whatever user is linked to the + # subscriber. if member.subscriber.display_name: display_name = member.subscriber.display_name - elif member.user: - display_name = ('' if member.user.display_name is None - else member.user.display_name) + # If an unlinked address is subscribed tehre will be no .user. + elif member.user is not None and member.user.display_name: + display_name = member.user.display_name else: display_name = '' + # Get the text from the template. text = expand(welcome_message, dict( fqdn_listname=mlist.fqdn_listname, list_name=mlist.display_name, |
