diff options
author | Mark Sapiro <mark@msapiro.net> | 2009-01-20 12:22:08 -0800 |
---|---|---|
committer | Mark Sapiro <mark@msapiro.net> | 2009-01-20 12:22:08 -0800 |
commit | c0da6af58657b1fe5730d3dea0e78bc17dac490a (patch) | |
tree | 76b912982fc75ac4bfd9b607c5a2e187497d9ef7 | |
parent | 150b03583ed0b2937b5cf7b46723a8e1eb49be63 (diff) | |
download | mailman2-c0da6af58657b1fe5730d3dea0e78bc17dac490a.tar.gz mailman2-c0da6af58657b1fe5730d3dea0e78bc17dac490a.tar.xz mailman2-c0da6af58657b1fe5730d3dea0e78bc17dac490a.zip |
Two of the 'new' class exceptions are raised with an argument.
-rw-r--r-- | Mailman/Cgi/subscribe.py | 9 | ||||
-rw-r--r-- | Mailman/Errors.py | 17 |
2 files changed, 18 insertions, 8 deletions
diff --git a/Mailman/Cgi/subscribe.py b/Mailman/Cgi/subscribe.py index 3661dcde..80019581 100644 --- a/Mailman/Cgi/subscribe.py +++ b/Mailman/Cgi/subscribe.py @@ -1,4 +1,4 @@ -# Copyright (C) 1998-2003 by the Free Software Foundation, Inc. +# Copyright (C) 1998-2009 by the Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License @@ -12,7 +12,8 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +# USA. """Process subscription or roster requests from listinfo form.""" @@ -204,8 +205,8 @@ your subscription.""") if privacy_results: results = privacy_results else: - # We need to interpolate into x - x = _(x) + # We need to interpolate into x.__str__() + x = _(str(x)) results = _("""\ Your subscription request was deferred because %(x)s. Your request has been forwarded to the list moderator. You will receive email informing you of the diff --git a/Mailman/Errors.py b/Mailman/Errors.py index 5b377846..d4af216e 100644 --- a/Mailman/Errors.py +++ b/Mailman/Errors.py @@ -1,4 +1,4 @@ -# Copyright (C) 1998-2003 by the Free Software Foundation, Inc. +# Copyright (C) 1998-2009 by the Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License @@ -12,7 +12,8 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, +# USA. """Shared mailman errors and messages.""" @@ -51,9 +52,17 @@ class MMInvalidCookieError(MMCookieError): pass class MMMustDigestError: pass class MMCantDigestError: pass -class MMNeedApproval: pass +class MMNeedApproval: + def __init__(self, message=None): + self.message = message + def __str__(self): + return self.message or '' class MMSubscribeNeedsConfirmation: pass -class MMBadConfirmation: pass +class MMBadConfirmation: + def __init__(self, message=None): + self.message = message + def __str__(self): + return self.message or '' class MMAlreadyDigested: pass class MMAlreadyUndigested: pass |