l.r.i.w.ITeamMembership(Interface) : interface documentation

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

TeamMembership for Users.

This table includes direct team members only. Indirect memberships are handled by the TeamParticipation table.

Int id Undocumented
Int personID Undocumented
Attribute proposed_by Proponent
Attribute reviewed_by The team admin who approved/rejected the member.
Attribute acknowledged_by The person (usually the member or someone acting on their behalf) that acknowledged (accepted/declined) a membership invitation.
Datetime date_created The date in which this membership was created.
Datetime date_proposed The date in which this membership was proposed.
Datetime date_acknowledged The date in which this membership was acknowledged by the member (or someone acting on their behalf).
Datetime date_reviewed The date in which this membership was approved/rejected by one of the team's admins.
Datetime date_last_changed The date in which this membership was last changed.
Text proponent_comment Undocumented
Text acknowledger_comment Undocumented
Text reviewer_comment Undocumented
Method isExpired Return True if this membership's status is EXPIRED.
Method canChangeExpirationDate Can the given person change this membership's expiration date?
Method setExpirationDate Set this membership's expiration date.
Method canBeRenewedByMember Can this membership be renewed by the member themselves?
Method sendSelfRenewalNotification Send an email to the team admins notifying that this membership
Method sendExpirationWarningEmail Send the member an email warning that the membership will expire.
Method setStatus Set the status of this membership.
id =
Undocumented
personID =
Undocumented
proposed_by =
Proponent
reviewed_by =
The team admin who approved/rejected the member.
acknowledged_by =
The person (usually the member or someone acting on their behalf) that acknowledged (accepted/declined) a membership invitation.
date_created =
The date in which this membership was created.
date_proposed =
The date in which this membership was proposed.
date_acknowledged =
The date in which this membership was acknowledged by the member (or someone acting on their behalf).
date_reviewed =
The date in which this membership was approved/rejected by one of the team's admins.
date_last_changed =
The date in which this membership was last changed.
proponent_comment =
Undocumented
acknowledger_comment =
Undocumented
reviewer_comment =
Undocumented
def isExpired():
Return True if this membership's status is EXPIRED.
def canChangeExpirationDate(person):
Can the given person change this membership's expiration date?

A membership's expiration date can be changed by the team owner, by a Launchpad admin or by a team admin. In the latter case, though, the expiration date can only be changed if the admin is not changing their own membership.

@call_with(REQUEST_USER)
@operation_parameters(copy_field(dateexpires))
@export_write_operation()
def setExpirationDate(date, user):
Set this membership's expiration date.

The given date must be None or in the future and the given user must be allowed to change this membership's expiration date as per the rules defined in canChangeExpirationDate().

def canBeRenewedByMember():
Can this membership be renewed by the member themselves?

A membership can be renewed if the team's renewal policy is ONDEMAND, the membership itself is active (status = [ADMIN|APPROVED]) and it's set to expire in less than DAYS_BEFORE_EXPIRATION_WARNING_IS_SENT days.

def sendSelfRenewalNotification():
Send an email to the team admins notifying that this membership has been renewed by the member themselves.

This method must not be called if the team's renewal policy is not ONDEMAND.

def sendExpirationWarningEmail():
Send the member an email warning that the membership will expire.

This method cannot be called for memberships without an expiration date. Emails are not sent to members if their membership has already expired or if the member is no longer active.

RaisesAssertionErrorif the member has no expiration date of the team or if the TeamMembershipRenewalPolicy is AUTOMATIC.
@call_with(REQUEST_USER)
@operation_parameters(copy_field(status), copy_field(reviewer_comment), Bool(_('Do not send notifications of status change. For use by Launchpad administrators only.'), False, False))
@export_write_operation()
def setStatus(status, user, comment=None, silent=False):
Set the status of this membership.

The user and comment are stored in last_changed_by and last_change_comment and may also be stored in proposed_by (and proponent_comment), reviewed_by (and reviewer_comment) or acknowledged_by (and acknowledger_comment), depending on the state transition.

The given status must be different than the current status.

Return True if the status got changed, otherwise False.

API Documentation for Launchpad, generated by pydoctor at 2022-06-16 00:00:12.