l.r.m.person : module documentation

Part of lp.registry.model

Implementation classes for a Person.
Class AlreadyConvertedException Raised when an attempt to claim a team that has been claimed.
Class JoinTeamEvent See IJoinTeamEvent.
Class TeamInvitationEvent See IJoinTeamEvent.
Class ValidPersonCache Flags if a Person is active and usable in Launchpad.
Function validate_person_visibility Validate changes in visibility.
Function get_person_visibility_terms Generate the query needed for person privacy filtering.
Function person_sort_key Identical to person_sort_key in the database.
Class PersonSettings The relatively rarely used settings for person (not a team).
Function readonly_settings Make an object that disallows writes to values on the interface.
Class Person A Person.
Class PersonSet The set of persons.
Class PersonLanguage Undocumented
Class SSHKey Undocumented
Class SSHKeySet No class docstring; 1/5 methods documented
Class WikiName Undocumented
Class WikiNameSet No class docstring; 3/3 methods documented
Class JabberID Undocumented
Class JabberIDSet No class docstring; 3/3 methods documented
Class IrcID See IIrcID
Class IrcIDSet See IIrcIDSet
Class NicknameGenerationError I get raised when something went wrong generating a nickname.
Function generate_nick Generate a LaunchPad nick from the email address provided.
Function person_from_account Adapt an IAccount into an IPerson.
Function get_recipients Return a set of people who receive email for this Person (person/team).
Function _is_nick_registered Answer the question: is this nick registered?
Function _get_recipients_for_team Given a team without a preferred email, return recipients.
def validate_person_visibility(person, attr, value):
Validate changes in visibility.

Prevent teams with links to other objects from transitioning, ignoring known-OK links.

def get_person_visibility_terms(user):
Generate the query needed for person privacy filtering.
def person_sort_key(person):
Identical to person_sort_key in the database.
def readonly_settings(message, interface):
Make an object that disallows writes to values on the interface.

When you write, the message is raised in a NotImplementedError.

def _is_nick_registered(nick):
Answer the question: is this nick registered?
def generate_nick(email_addr, is_registered=_is_nick_registered):
Generate a LaunchPad nick from the email address provided.

See lp.app.validators.name for the definition of a valid nick.

It is technically possible for this function to raise a NicknameGenerationError, but this will only occur if an operator has majorly screwed up the name blacklist.

@adapter(IAccount)
@implementer(IPerson)
def person_from_account(account):
Adapt an IAccount into an IPerson.

If there is a current browser request, we cache the looked up Person in the request's annotations so that we don't have to hit the DB once again when further adaptation is needed. We know this cache may cross transaction boundaries, but this should not be a problem as the Person -> Account link can't be changed.

This cache is necessary because our security adapters may need to adapt the Account representing the logged in user into an IPerson multiple times.

@ProxyFactory
def get_recipients(person):
Return a set of people who receive email for this Person (person/team).

If <person> has a preferred email, then if <person> is a team or has an active account the set will contain only that person, otherwise the set will be empty. If <person> doesn't have a preferred email but is a team, the set will contain the preferred email address of each member of <person>, including indirect members, that has an active account and a preferred (active) address.

Finally, if <person> doesn't have a preferred email and is not a team, the set will be empty.

def _get_recipients_for_team(team):
Given a team without a preferred email, return recipients.

Helper for get_recipients, divided out simply to make get_recipients easier to understand in broad brush.

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