[Mailman-Developers] config_list bug with subscribe_policy
Hrvoje Niksic
hniksic@iskon.hr
27 Jul 2000 09:32:17 +0200
bwarsaw@beopen.com (Barry A. Warsaw) writes:
> | # 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
> Hrvoje> use config_list to import lists to Mailman.
>
> Try this patch.
Yes, it seems to work fine now. Thanks!
> - 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
I propose that you remove this kludge by setting the values to
*always* be in the [0, 3) range, except that setting it to zero is
disallowed if the site disallows it. In that case, the graphical
tools could simply gray out the 0th option.