[Mailman-Users] default action on administrative requests

Richard Barrett r.barrett at ftel.co.uk
Wed Jul 30 17:20:36 CEST 2003


On Wednesday, July 30, 2003, at 03:06  pm, Heath Raftery wrote:

> Hi Hal,
>
> On Wednesday, July 30, 2003, at 11:36  AM, Hal Huntley wrote:
>>
>> I have a list that gets more spam than legit email. I would like to 
>> have the
>> "Action to take on all these held messages" on the 
>> "admindb/<listname>" page
>> to have a default of "discard" instead of "defer". This way I can 
>> quickly
>> scan the "baddies" and then "submit all data" once I see they are all 
>> spam;
>> no clicking on the "Discard" radio button.
>
> Not a definitive answer, but I've found the following in 
> Mailman/Mailman/Cgi/admindb.py:
>
> radio = RadioButtonArray(id, (_('Defer'),
>                               _('Approve'),
>                               _('Reject'),
>                               _('Discard')),
>                                  values=(mm_cfg.DEFER,
>                                          mm_cfg.SUBSCRIBE,
>                                          mm_cfg.REJECT,
>                                          mm_cfg.DISCARD),
>                                  checked=0).Format()
>
> I reckon (but have not confirmed) that you could change the checked=0 
> bit to
> checked=4 for Approve
> checked=2 for Reject
> checked=3 for Discard

Not quite. The value assigned to the checked parameter is the offset of 
the radio button in the array which is initially checked when the form 
is rendered; the value is the offset in the preceding list of button 
names and their values. So:

checked=0 means the 'Defer' button would be checked
checked=1 means the 'Approve' button would be checked
checked=2 means the 'Reject' button would be checked
checked=3 means the 'Discard' button would be checked

>
> (got these values from the HTML source generated in a typical 
> Administrative Requests page)
>
> This seems to put a CHECKED flag in the <INPUT> tag, which I'm not 
> actually sure is valid HTML.

It is valid HTML. CHECKED (without any value associated) is a valid 
attribute of an INPUT tag of TYPE="radio". It causes that radio button 
to be in the "on" state when the form is initially displayed.

> My reading seems to suggest that a value="Yes" is required instead. If 
> that is not visible, then the standard is unclear. One version says 
> the user agent should select the first radio button in the group, so 
> you may want to try rearranging the order of the buttons in the 
> RadioButtonArray above instead.
>
>> Right now, I also wish this behavior for one list only, not as a 
>> default for
>> all the lists that I have.
>
> Hmm, dunno about that!
>

If you hack the code in the admindb.py file then the changes will 
affect all lists equally.

> Hope that helps, tell us how you go!
> Heath
> -- 
>  ________________________________________________________
> |   Heath Raftery                                        |
> |   hraftery at myrealbox.com                               |
> |   *There's nothing like a depressant to cheer you up*  |
> |                       - Heard at Moe's Tavern          |
> |                                         _\|/_          |
> |________________________________________m(. .)m_________|





More information about the Mailman-Users mailing list