diff options
| author | bwarsaw | 2006-09-24 20:43:56 +0000 |
|---|---|---|
| committer | bwarsaw | 2006-09-24 20:43:56 +0000 |
| commit | 99a4f0ef16e6dfddafbd396896afb97821528f16 (patch) | |
| tree | 0cabc1a41a6532de1ad63a1b43bd2e941150d0ec /Mailman | |
| parent | 3da41d89a8c827383b2256b965fa1be8b179b9cd (diff) | |
| download | mailman-99a4f0ef16e6dfddafbd396896afb97821528f16.tar.gz mailman-99a4f0ef16e6dfddafbd396896afb97821528f16.tar.zst mailman-99a4f0ef16e6dfddafbd396896afb97821528f16.zip | |
As Mark discovered, we need to load the configuration in the driver script for
the web u/i to work. This also fixes the use of Utils.list_names() in the
list and admin overviews. This API now returns a set, but the CGIs want to
sort them, so we need to turn them back into lists.
This change also elaborates an exception so that the list name is reported.
Diffstat (limited to 'Mailman')
| -rw-r--r-- | Mailman/Cgi/admin.py | 2 | ||||
| -rw-r--r-- | Mailman/Cgi/listinfo.py | 2 | ||||
| -rw-r--r-- | Mailman/Errors.py | 9 | ||||
| -rw-r--r-- | Mailman/MailList.py | 2 |
4 files changed, 11 insertions, 4 deletions
diff --git a/Mailman/Cgi/admin.py b/Mailman/Cgi/admin.py index 3ba876340..ed033d49a 100644 --- a/Mailman/Cgi/admin.py +++ b/Mailman/Cgi/admin.py @@ -218,7 +218,7 @@ def admin_overview(msg=''): bgcolor=mm_cfg.WEB_HEADER_COLOR) # Skip any mailing list that isn't advertised. advertised = [] - listnames = Utils.list_names() + listnames = list(Utils.list_names()) listnames.sort() for name in listnames: diff --git a/Mailman/Cgi/listinfo.py b/Mailman/Cgi/listinfo.py index d8281ccea..37c7f8ea9 100644 --- a/Mailman/Cgi/listinfo.py +++ b/Mailman/Cgi/listinfo.py @@ -82,7 +82,7 @@ def listinfo_overview(msg=''): # Skip any mailing lists that isn't advertised. advertised = [] - listnames = Utils.list_names() + listnames = list(Utils.list_names()) listnames.sort() for name in listnames: diff --git a/Mailman/Errors.py b/Mailman/Errors.py index a0fdd8c52..26333a688 100644 --- a/Mailman/Errors.py +++ b/Mailman/Errors.py @@ -28,7 +28,14 @@ class MailmanException(Exception): # Exceptions for problems related to opening a list class MMListError(MailmanException): pass -class MMUnknownListError(MMListError): pass + +class MMUnknownListError(MMListError): + def __init__(self, listname=None): + self._listname = listname + + def __str__(self): + return self._listname + class MMCorruptListDatabaseError(MMListError): pass class MMListNotReadyError(MMListError): pass class MMListAlreadyExistsError(MMListError): pass diff --git a/Mailman/MailList.py b/Mailman/MailList.py index dcf70a94a..89ace8565 100644 --- a/Mailman/MailList.py +++ b/Mailman/MailList.py @@ -647,7 +647,7 @@ class MailList(HTMLFormatter, Deliverer, ListAdmin, if fqdn_listname is None: fqdn_listname = self.fqdn_listname if not Utils.list_exists(fqdn_listname): - raise Errors.MMUnknownListError + raise Errors.MMUnknownListError(fqdn_listname) self._memberadaptor.load() # We first try to load config.pck, which contains the up-to-date # version of the database. If that fails, perhaps because it's |
