c.l.b.l.BaseTokenView : class documentation

Part of canonical.launchpad.browser.logintoken View In Hierarchy

Known subclasses: canonical.launchpad.browser.logintoken.BugTrackerHandshakeView, canonical.launchpad.browser.logintoken.ClaimTeamView, canonical.launchpad.browser.logintoken.MergePeopleView, canonical.launchpad.browser.logintoken.ValidateEmailView, canonical.launchpad.browser.logintoken.ValidateGPGKeyView

A view class to be used by other {Login,Auth}Token views.
Method next_url The next URL to redirect to on successful form submission.
Method page_title The page title.
Method redirectIfInvalidOrConsumedToken If this is a consumed or invalid token redirect to the LoginToken
Method success Indicate to the user that the token was successfully processed.
Method logInPrincipalByEmail Login the principal with the given email address.
Method accountWasSuspended Return True if the person's account was SUSPENDED, otherwise False.
Method _cancel Consume the LoginToken and set self._next_url_for_cancel.
@property
def next_url(self):
The next URL to redirect to on successful form submission.

When the cancel action is used, self._next_url_for_cancel won't be None so we return that. Otherwise we return self.default_next_url.

@property
def page_title(self):
The page title.
def redirectIfInvalidOrConsumedToken(self):
If this is a consumed or invalid token redirect to the LoginToken default view and return True.

An invalid token is a token used for a purpose it wasn't generated for (i.e. create a new account with a VALIDATEEMAIL token).

def success(self, message):
Indicate to the user that the token was successfully processed.

This involves adding a notification message, and redirecting the user to their Launchpad page.

def logInPrincipalByEmail(self, email):
Login the principal with the given email address.
def _cancel(self):
Consume the LoginToken and set self._next_url_for_cancel.

_next_url_for_cancel is set to the home page of this LoginToken's requester.

def accountWasSuspended(self, account, reason):
Return True if the person's account was SUSPENDED, otherwise False.

When the account was SUSPENDED, the Warning Notification with the reason is added to the request's response. The LoginToken is consumed.

ParametersaccountThe IAccount.
reasonA sentence that explains why the SUSPENDED account cannot be used.
API Documentation for Launchpad, generated by pydoctor at 2010-09-27 00:00:11.