Code review comment for lp:~edwin-grubbs/launchpad/bug-230801-renewing-membership

Revision history for this message
Edwin Grubbs (edwin-grubbs) wrote :

Summary
-------

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.

Tests
-----

./bin/test -vvt 'xx-member-renewed-membership.txt|teammembership-email-notification.txt'

Demo and Q/A
------------

* 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.

« Back to merge proposal