Part of lp.registry.interfaces.teammembership View In Hierarchy
| Method | handleMembershipsExpiringToday | Expire or renew the memberships flagged to expire today. |
| Method | getMembershipsToExpire | Return all TeamMemberships that should be expired. |
| Method | new | Create and return a TeamMembership for the given person and team. |
| Method | getByPersonAndTeam | Return the TeamMembership object for the given person and team. |
| Method | deactivateActiveMemberships | Deactivate all team members in ACTIVE_STATES. |
If the team's renewal policy is AUTOMATIC, renew the membership (keeping the same status) and send a notification to the member and team admins. Otherwise flag the membership as expired.
If when is None, we use datetime.now().
A TeamMembership should be expired when its expiry date is prior or equal to :when: and its status is either ADMIN or APPROVED.
| Parameters | status | The TeamMembership's status. Must be one of APPROVED, PROPOSED or ADMIN. If the status is APPROVED or ADMIN, this method will also take care of filling the TeamParticipation table. |
| user | The person whose action triggered this membership's creation. | |
| dateexpires | The date in which the membership should expire. | |
| comment | The rationale for this membership's creation. |