On Sep 16, 2009, at 10:24 PM, Brad Crittenden wrote:
>The changes look good. Thanks for taking the time to make a lot of drive-by fixes.
>
>I've got a few questions below.
Thanks for the review Brad!
>> === modified file 'lib/lp/registry/browser/person.py'
>> --- lib/lp/registry/browser/person.py 2009-09-16 17:07:14 +0000
>> +++ lib/lp/registry/browser/person.py 2009-09-16 21:19:47 +0000
>> @@ -4086,6 +4086,8 @@
>> custom_widget('mailing_list_auto_subscribe_policy',
>> LaunchpadRadioWidgetWithDescription)
>>
>> + label = 'Change your e-mail settings'
>> +
>> def initialize(self):
>> if self.context.is_team:
>> # +editemails is not available on teams.
>> @@ -4191,13 +4193,11 @@
>> which the user is subscribed to this mailing list.
>> """
>> subscription = mailing_list.getSubscription(self.context)
>> - if subscription is not None:
>> - if subscription.email_address is None:
>> - return "Preferred address"
>> - else:
>> - return subscription.email_address
>> - else:
>> + if subscription is None:
>> return "Don't subscribe"
>> + if subscription.email_address is None:
>
>Hmm, I'd have used an elif.
Changed.
>
>> + return 'Preferred address'
>> + return subscription.email_address
>>
>> def _mailing_list_fields(self):
>> """Creates a field for each mailing list the user can subscribe to.
>> @@ -4233,8 +4235,22 @@
>> @property
>> def mailing_list_widgets(self):
>> """Return all the mailing list subscription widgets."""
>> - return [widget for widget in self.widgets
>> - if 'field.subscription.' in widget.name]
>> + mailing_list_set = getUtility(IMailingListSet)
>> + widgets = []
>> + for widget in self.widgets:
>> + if 'field.subscription.' in widget.name:
>
>Why not use 'startswith'? Can it really be anywhere in the name?
Good call. This was cut-and-pasted from the original code, but .startswith()
is better, so I changed this.
>> @@ -87,24 +77,21 @@
>> lists. You can subscribe to a team's mailing list using any of
>> your verified email addresses.
>>
>> -