This branch fixes an oops caused by the user double clicking
on the /~$user/+expiringmembership/$team form's submit button.
The view class now checks if the membership can be renewed
before calling the method in the model that raises the exception.
The view still displays the message saying that the membership has been
renewed, because it is very unlikely that the user would be able to try to
renew an unrenewable membership without double clicking, since the form will
not show up on the page if the membership will not be expiring within seven
days.
* Log in as <email address hidden>
* Open http://launchpad.dev/~guadamen/+members
* Edit Foo Bar's membership.
* Set the expiration within 7 days in the future.
(Surprisingly, you can set the team's admin's membership to expire, and
before this fix the admin would get the same exception when double
clicking to renew the membership.)
* Open http://launchpad.dev/~name16/+expiringmembership/guadamen
* Double click on the Renew button.
* Instead of an OOPS, you should the person index page with a notice
that the membership has been renewed to some time next year.
Summary
-------
This branch fixes an oops caused by the user double clicking +expiringmember ship/$team form's submit button.
on the /~$user/
The view class now checks if the membership can be renewed
before calling the method in the model that raises the exception.
The view still displays the message saying that the membership has been
renewed, because it is very unlikely that the user would be able to try to
renew an unrenewable membership without double clicking, since the form will
not show up on the page if the membership will not be expiring within seven
days.
Tests
-----
./bin/test -vvt 'xx-member- renewed- membership. txt|teammembers hip-email- notification. txt'
Demo and Q/A
------------
* Log in as <email address hidden> launchpad. dev/~guadamen/ +members launchpad. dev/~name16/ +expiringmember ship/guadamen
* Open http://
* Edit Foo Bar's membership.
* Set the expiration within 7 days in the future.
(Surprisingly, you can set the team's admin's membership to expire, and
before this fix the admin would get the same exception when double
clicking to renew the membership.)
* Open http://
* Double click on the Renew button.
* Instead of an OOPS, you should the person index page with a notice
that the membership has been renewed to some time next year.