l.r.i.t.ITeamMembershipSet(Interface) : interface documentation

Part of lp.registry.interfaces.teammembership View In Hierarchy

A Set for TeamMembership objects.
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.
def handleMembershipsExpiringToday(reviewer):
Expire or renew the memberships flagged to expire today.

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.

def getMembershipsToExpire(when=None):
Return all TeamMemberships that should be 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.

def new(person, team, status, user, dateexpires=None, comment=None):
Create and return a TeamMembership for the given person and team.
ParametersstatusThe 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.
userThe person whose action triggered this membership's creation.
dateexpiresThe date in which the membership should expire.
commentThe rationale for this membership's creation.
def getByPersonAndTeam(person, team):
Return the TeamMembership object for the given person and team.

If the given person or team is None, there will obviously be no TeamMembership and I'll return None.

def deactivateActiveMemberships(team, comment, reviewer):
Deactivate all team members in ACTIVE_STATES.

This is a convenience method used before teams are deleted.

ParametersteamThe team to deactivate.
commentAn explanation for the deactivation.
reviewerThe user doing the deactivation.
API Documentation for Launchpad, generated by pydoctor at 2022-06-16 00:00:12.