diff options
author | Mark Sapiro <mark@msapiro.net> | 2015-07-20 20:28:37 -0700 |
---|---|---|
committer | Mark Sapiro <mark@msapiro.net> | 2015-07-20 20:28:37 -0700 |
commit | ec42db5ca3b3b71255390404cc73307d8ff5efca (patch) | |
tree | ae16e5ae0848bd3b02fa0a75e825651006d392f4 /Mailman | |
parent | 5c01d482cc37706251892ea1b620b221da2d2ca4 (diff) | |
download | mailman2-ec42db5ca3b3b71255390404cc73307d8ff5efca.tar.gz mailman2-ec42db5ca3b3b71255390404cc73307d8ff5efca.tar.xz mailman2-ec42db5ca3b3b71255390404cc73307d8ff5efca.zip |
Don't show digest options on user's options page for non-digestable lists.
Diffstat (limited to '')
-rw-r--r-- | Mailman/Cgi/options.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/Mailman/Cgi/options.py b/Mailman/Cgi/options.py index a094047e..c400e9fb 100644 --- a/Mailman/Cgi/options.py +++ b/Mailman/Cgi/options.py @@ -17,6 +17,7 @@ """Produce and handle the member options.""" +import re import sys import os import cgi @@ -36,6 +37,9 @@ from Mailman.Logging.Syslog import syslog OR = '|' SLASH = '/' SETLANGUAGE = -1 +DIGRE = re.compile( + '<!--Start-Digests-Delete-->.*<!--End-Digests-Delete-->', + re.DOTALL) # Set up i18n _ = i18n._ @@ -873,8 +877,10 @@ You are subscribed to this list with the case-preserved address else: replacements['<mm-case-preserved-user>'] = '' - doc.AddItem(mlist.ParseTags('options.html', replacements, userlang)) - + page_text = mlist.ParseTags('options.html', replacements, userlang) + if not (mlist.digestable or mlist.getMemberOption(user, mm_cfg.Digests)): + page_text = DIGRE.sub('', page_text) + doc.AddItem(page_text) def loginpage(mlist, doc, user, lang): |