~xav0989/ubuntu/vivid/mailman/ubuntu-logo

« back to all changes in this revision

Viewing changes to Mailman/Cgi/admindb.py

  • Committer: Bazaar Package Importer
  • Author(s): Thijs Kinkhorst
  • Date: 2009-03-14 14:18:16 UTC
  • mfrom: (1.1.5 upstream) (2.2.5 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090314141816-ngrjwz59tihjh4hz
Tags: 1:2.1.12-1
* New upstream release.
  + Minimum Python version is now 2.4.
  + Patches obsoleted (incorporated or not useful anymore):
    00_stolen_from_HEAD,
    11_handle_propfind.patch,
    32_MIME_fixup,
    62_new_list_bad_pending_requests,
    67_update_handle_old_versions,
    68_update_catalan,
    78_DeprecationWarning,
    80_fix_string_search.
    Refresh all others. Many thanks to Mark Sapiro and
    Paul Wise for the help in cleaning this up.
  + Fixes bounce handling NotAMemberError (closes: #517997).
* Various packaging cleanups, upgrade debhelper to level 7.
* Removes embedded copy of pythonlib/email module.
* Checked for policy 3.8.1, remove shipped var/{run,lock}
  dirs, they are already created correctly by the init script.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 1998-2007 by the Free Software Foundation, Inc.
 
1
# Copyright (C) 1998-2009 by the Free Software Foundation, Inc.
2
2
#
3
3
# This program is free software; you can redistribute it and/or
4
4
# modify it under the terms of the GNU General Public License
34
34
from Mailman import Message
35
35
from Mailman import i18n
36
36
from Mailman.Handlers.Moderate import ModeratedMemberPost
 
37
from Mailman.ListAdmin import HELDMSG
37
38
from Mailman.ListAdmin import readMessage
38
39
from Mailman.Cgi import Auth
39
40
from Mailman.htmlformat import *
554
555
 
555
556
 
556
557
def show_post_requests(mlist, id, info, total, count, form):
557
 
    # For backwards compatibility with pre 2.0beta3
558
 
    if len(info) == 5:
559
 
        ptime, sender, subject, reason, filename = info
560
 
        msgdata = {}
561
 
    else:
562
 
        ptime, sender, subject, reason, filename, msgdata = info
 
558
    # Mailman.ListAdmin.__handlepost no longer tests for pre 2.0beta3
 
559
    ptime, sender, subject, reason, filename, msgdata = info
563
560
    form.AddItem('<hr>')
564
561
    # Header shown on each held posting (including count of total)
565
562
    msg = _('Posting Held for Approval')
709
706
            preserve = actions.get('senderpreserve', 0)
710
707
            forward = actions.get('senderforward', 0)
711
708
            forwardaddr = actions.get('senderforwardto', '')
712
 
            comment = _('No reason given')
713
709
            bysender = helds_by_sender(mlist)
714
710
            for id in bysender.get(sender, []):
715
711
                try:
 
712
                    msgdata = mlist.GetRecord(id)[5]
 
713
                    comment = msgdata.get('rejection_notice',
 
714
                                      _('[No explanation given]'))
716
715
                    mlist.HandleRequest(id, action, comment, preserve,
717
716
                                        forward, forwardaddr)
718
717
                except (KeyError, Errors.LostHeldMessage):
771
770
        forwardaddrkey = 'forward-addr-%d' % request_id
772
771
        bankey = 'ban-%d' % request_id
773
772
        # Defaults
774
 
        comment = _('[No reason given]')
 
773
        if mlist.GetRecordType(request_id) == HELDMSG:
 
774
            msgdata = mlist.GetRecord(request_id)[5]
 
775
            comment = msgdata.get('rejection_notice',
 
776
                                  _('[No explanation given]'))
 
777
        else:
 
778
            comment = _('[No explanation given]')
775
779
        preserve = 0
776
780
        forward = 0
777
781
        forwardaddr = ''