Merge lp:~jimpop/mailman/owner-notification-whence into lp:mailman/2.1

Proposed by Jim Popovitch
Status: Merged
Merged at revision: 1769
Proposed branch: lp:~jimpop/mailman/owner-notification-whence
Merge into: lp:mailman/2.1
Diff against target: 35 lines (+4/-2)
3 files modified
Mailman/MailList.py (+2/-0)
templates/en/adminsubscribeack.txt (+1/-1)
templates/en/adminunsubscribeack.txt (+1/-1)
To merge this branch: bzr merge lp:~jimpop/mailman/owner-notification-whence
Reviewer Review Type Date Requested Status
Mark Sapiro Approve
Review via email: mp+347785@code.launchpad.net

Commit message

This small change adds the whence text to sub/unsub notifications sent to list owners.

To post a comment you must log in.
1769. By Jim Popovitch

Add whence to owner subscribe|unsubscribe notifications.

Revision history for this message
Mark Sapiro (msapiro) wrote :

I made a few minor tweaks, but it's good. Thanks for the contribution.

review: Approve
Revision history for this message
Jim Popovitch (jimpop) wrote :

Ugh oh. I fear that one of those tweaks may cause a potential problem. The whence text
     i.e "via email confirmation"
has no leading space, so when it is appended in adminsubscribeack.txt like:
    %(listname)s%(whence)s.
the two variables will run together like
   "has been successfully subscribed to mailman-usersvia email confirmation."
That's why I was using
   if whence == None else " (" + whence + ")"
in Mailman/MailList.py (2 places).

Thoughts?

Revision history for this message
Jim Popovitch (jimpop) wrote :

Scratch that! I see where you also modified the templates to place whence text on the 2nd line.

Revision history for this message
Mark Sapiro (msapiro) wrote :

On 6/12/18 8:14 AM, Jim Popovitch wrote:
> Scratch that! I see where you also modified the templates to place whence text on the 2nd line.
>

Yeah, but it gets quite messy anyway. I was thinking that putting
%(whence)s on a separate line would help avoid grammar issues with i18n,
but the text gets wrapped anyway by Utils.findtext(). But even when
wrapped the newline adds a space, so it's OK for English.

The big issue with i18n is none of the 'whence' values are translated so
things like (via web confirmation) will be in English regardless of the
language.

For now, I'm just going to ignore the whole i18n issue.

--
Mark Sapiro <email address hidden> The highway is for gamblers,
San Francisco Bay Area, California better use your sense - B. Dylan

Revision history for this message
Jim Popovitch (jimpop) wrote :

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

On Tue, 2018-06-12 at 15:30 +0000, Mark Sapiro wrote:
>
> For now, I'm just going to ignore the whole i18n issue.

I've been saying that since the 90s and no one has complained loudly
yet. :-) DBCS ftw!
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEPxwe8uYBnqxkbORSJxVetMRaJwUFAlsgE/sACgkQJxVetMRa
JwXt9Q//QaGlsL8DTGZPkOx51Yo07JkSO7ZjUAafe4iF+ffebdzzauk2X4uN+aOo
ueLysf+cfyF+NlOfabyoIfemt1hwwmXOH2nD5qX2nf2c1NGLh1zi6k+04qFohuYW
6ZGgAm15Nm4CfRxtjEJDc/Pt1EKuVDSgYZsJBvBmf2dulOB9eev5ckJMudLQqUZb
/iblrJ82OGuemn5nk3RBX1SxmEho6NAHmczQE9LC2q+7hoEchxWN9f8YlNI9PNIp
yAppKEnOpySM8QDtE6EMD3GJaJzgBB9DeSAimAvXI5/YyRs5yInGW7s++A0GBzJt
DvxXyp48PefOcRcEjnITQbA0BCuMUcBcYwCFPVq/E7eqax3grJApOepfa5loN2X5
ZtsSUqbiOvgJISPzbgzCTtGhRaMrx1pn/9qOv7k55PlyFtjzar1DOOcrhPFqGKE4
1ZLjcbIPcQo8iaU5DovjJILRnUtl9m/tuXaW/a1d/++fG+jGqas3ibM0EbGYL+4l
rG003Wy7BSYQbVl2zGQoUhK7Idlp8gKRx3aETAmw59INGDdvb2zXydek2q5mme3a
cV9W5NRf9mLX2fxpg/fwKDkkxM+IVkkKH6x1Lys6HN51KhCQX3RUZZTi8UAt2Uzs
3tILtUPCF2PxC0E/CkkG2FZr41DPLkL0NJ6QG+YR/iN4XlpSD3o=
=xKW5
-----END PGP SIGNATURE-----

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Mailman/MailList.py'
2--- Mailman/MailList.py 2018-06-10 23:01:35 +0000
3+++ Mailman/MailList.py 2018-06-12 02:05:50 +0000
4@@ -1069,6 +1069,7 @@
5 "adminsubscribeack.txt",
6 {"listname" : realname,
7 "member" : formataddr((name, email)),
8+ "whence" : "" if whence == None else " (" + whence + ")"
9 }, mlist=self)
10 msg = Message.OwnerNotification(self, subject, text)
11 msg.send(self)
12@@ -1105,6 +1106,7 @@
13 'adminunsubscribeack.txt',
14 {'member' : name,
15 'listname': self.real_name,
16+ "whence" : "" if whence == None else " (" + whence + ")"
17 }, mlist=self)
18 msg = Message.OwnerNotification(self, subject, text)
19 msg.send(self)
20
21=== modified file 'templates/en/adminsubscribeack.txt'
22--- templates/en/adminsubscribeack.txt 2003-01-02 05:25:50 +0000
23+++ templates/en/adminsubscribeack.txt 2018-06-12 02:05:50 +0000
24@@ -1,3 +1,3 @@
25-%(member)s has been successfully subscribed to %(listname)s.
26+%(member)s has been successfully subscribed to %(listname)s%(whence)s.
27
28
29
30=== modified file 'templates/en/adminunsubscribeack.txt'
31--- templates/en/adminunsubscribeack.txt 2003-01-02 05:25:50 +0000
32+++ templates/en/adminunsubscribeack.txt 2018-06-12 02:05:50 +0000
33@@ -1,2 +1,2 @@
34-%(member)s has been removed from %(listname)s.
35+%(member)s has been removed from %(listname)s%(whence)s.
36