launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #11580
[Merge] lp:~stevenk/launchpad/fix-self-renewal into lp:launchpad
Steve Kowalik has proposed merging lp:~stevenk/launchpad/fix-self-renewal into lp:launchpad.
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
Related bugs:
Bug #1044457 in Launchpad itself: "group membership expire date "self renewal" can not be set: "Wrong Type""
https://bugs.launchpad.net/launchpad/+bug/1044457
For more details, see:
https://code.launchpad.net/~stevenk/launchpad/fix-self-renewal/+merge/122598
Fix the ability to change the self membership renewal on Team:+edit. This work was effectively done by Curtis Hovey, I've just packaged it up with a nice bow.
--
https://code.launchpad.net/~stevenk/launchpad/fix-self-renewal/+merge/122598
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~stevenk/launchpad/fix-self-renewal into lp:launchpad.
=== modified file 'lib/lp/registry/browser/team.py'
--- lib/lp/registry/browser/team.py 2012-08-15 22:01:39 +0000
+++ lib/lp/registry/browser/team.py 2012-09-03 22:26:22 +0000
@@ -92,7 +92,6 @@
)
from lp.app.widgets.owner import HiddenUserWidget
from lp.app.widgets.popup import PersonPickerWidget
-from lp.app.widgets.textwidgets import StrippedTextWidget
from lp.code.browser.sourcepackagerecipelisting import HasRecipesMenuMixin
from lp.registry.browser.branding import BrandingChangeView
from lp.registry.browser.mailinglists import enabled_with_active_mailing_list
@@ -299,7 +298,7 @@
custom_widget(
'renewal_policy', LaunchpadRadioWidget, orientation='vertical')
- custom_widget('defaultrenewalperiod', StrippedTextWidget,
+ custom_widget('defaultrenewalperiod', IntWidget,
widget_class='field subordinate')
custom_widget(
'membership_policy', LaunchpadRadioWidgetWithDescription,
=== modified file 'lib/lp/registry/browser/tests/test_team.py'
--- lib/lp/registry/browser/tests/test_team.py 2012-08-21 04:04:47 +0000
+++ lib/lp/registry/browser/tests/test_team.py 2012-09-03 22:26:22 +0000
@@ -442,6 +442,29 @@
'existing is already in use by another person or team.',
view.errors[0].doc())
+ def test_expiration_and_renewal(self):
+ # The team's membership expiration and renewal rules can be set.
+ owner = self.factory.makePerson()
+ team = self.factory.makeTeam(name="team", owner=owner)
+ form = {
+ 'field.name': team.name,
+ 'field.displayname': team.displayname,
+ 'field.defaultmembershipperiod': '180',
+ 'field.defaultrenewalperiod': '365',
+ 'field.membership_policy': 'RESTRICTED',
+ 'field.renewal_policy': 'ONDEMAND',
+ 'field.actions.save': 'Save',
+ }
+ login_person(owner)
+ view = create_initialized_view(team, '+edit', form=form)
+ self.assertEqual(0, len(view.errors))
+ self.assertEqual(
+ TeamMembershipPolicy.RESTRICTED, team.membership_policy)
+ self.assertEqual(180, team.defaultmembershipperiod)
+ self.assertEqual(365, team.defaultrenewalperiod)
+ self.assertEqual(
+ TeamMembershipRenewalPolicy.ONDEMAND, team.renewal_policy)
+
class TeamAdminisiterViewTestCase(TestTeamPersonRenameFormMixin,
TestCaseWithFactory):
Follow ups