[Mailman-Developers] config_list bug with subscribe_policy

Barry A. Warsaw bwarsaw@beopen.com
Thu, 27 Jul 2000 03:20:33 -0400 (EDT)


>>>>> "Hrvoje" == Hrvoje Niksic <hniksic@iskon.hr> writes:

    Hrvoje> The subscribe_policy parameter is a bit specific in that
    Hrvoje> it can be 0, 1, 2, or 3, except that 0 can be turned off
    Hrvoje> on a per-site basis (which is done by default, at least
    Hrvoje> under Debian).

    Hrvoje> The web GUI makes sure that the RadioButtonArray gets set
    Hrvoje> up with the current setting of subscribe_policy correctly
    Hrvoje> laid out, which depends on whether the site-wide option is
    Hrvoje> turned on or off.

    Hrvoje> However, the config_list utility does not seem to
    Hrvoje> understand the convention, and prints the following:

    | # legal values are:
    | #    0 = "confirm"
    | #    1 = "require approval"
    | #    2 = "confirm+approval"
    | subscribe_policy = 1

    Hrvoje> The number is correct, but the comment is not; the list in
    Hrvoje> question does not require approval -- it merely asks for
    Hrvoje> confirmation.

    Hrvoje> config_list should probably have a special-case for
    Hrvoje> subscribe_policy, as the graphical tools do.  Otherwise
    Hrvoje> the comment is very misleading for people who hope to use
    Hrvoje> config_list to import lists to Mailman.

Try this patch.
-Barry

-------------------- snip snip --------------------
Index: config_list
===================================================================
RCS file: /cvsroot/mailman/mailman/bin/config_list,v
retrieving revision 1.6
diff -u -r1.6 config_list
--- config_list	2000/07/24 21:44:56	1.6
+++ config_list	2000/07/27 07:18:41
@@ -144,7 +144,13 @@
                 elif vtype in (mm_cfg.Radio, mm_cfg.Toggle):
                     print '#'
                     print '# legal values are:'
-                    i = 0
+                    # TBD: This is disgusting, but it's special cased
+                    # everywhere else anyway...
+                    if varname == 'subscribe_policy' and \
+                           not mm_cfg.ALLOW_OPEN_SUBSCRIBE:
+                        i = 1
+                    else:
+                        i = 0
                     for choice in data[2]:
                         print '#   ', i, '= "%s"' % choice
                         i = i + 1