From a41aa936b93b2187257d5096ebfa4b2eb13b9603 Mon Sep 17 00:00:00 2001 From: bwarsaw Date: Fri, 13 Jul 2001 16:54:50 +0000 Subject: hold_for_approval(): Inside admin_immed_notify (i.e. when we're notifying the administrator of the held message), use the list's preferred_language to get the charset. This fixes the UnboundLocalError that occurs if dont_respond_to_post_requests and admin_immed_notify are both true (it shouldn't have been using `lang' in the first place, since that's the /user's/ preferred language, not the admin's). Bug found by Mentor Cana. --- Mailman/Handlers/Hold.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mailman/Handlers/Hold.py b/Mailman/Handlers/Hold.py index 0e7860b78..70dda67a7 100644 --- a/Mailman/Handlers/Hold.py +++ b/Mailman/Handlers/Hold.py @@ -274,7 +274,7 @@ def hold_for_approval(mlist, msg, msgdata, exc): subject = _('%(listname)s post from %(sender)s requires approval') msg = Message.UserNotification(owneraddr, owneraddr, subject, text) msg.addheader('Content-Type', 'text/plain', - charset=Utils.GetCharSet(lang)) + charset=Utils.GetCharSet(mlist.preferred_language)) msg.send(mlist, **{'tomoderators': 1}) finally: i18n.set_translation(otranslation) -- cgit v1.2.3-70-g09d2