VERIFICATION_FAILED= <VerificationResult: u'Failed'>¶
Signal that verifying an email address failed.
VERIFICATION_REDUNDANT= <VerificationResult: u'Redundant'>¶
Signal that verifying an email address was redundant.
VERIFICATION_STYMIED= <VerificationResult: u'Stymied'>¶
Signal that an email address is already verified for a different
VERIFICATION_SUCCEEDED= <VerificationResult: u'Succeeded'>¶
Signal that email verification succeeded.
Participants may associate email addresses with their account.
Email addresses are stored in an
email_addressestable in the database, which holds the addresses themselves as well as info related to address verification. While a participant may have multiple email addresses on file, verified or not, only one will be the primary email address: the one also recorded in
participants.email_address. It’s a bug for the primary address not to be verified, or for an address to be in
participants.email_addressbut not also in
Having a verified email is a prerequisite for certain other features on Gratipay, such as linking a PayPal account, or filing a national identity.
A boolean indicating whether there are email address verifications outstanding for this participant. Makes a db call.
Add an email address for a participant.
This is called when adding a new email address, and when resending the verification email for an unverified email address.
- EmailAlreadyVerified – if the email is already verified for this participant (unless they’re claiming packages)
- EmailTaken – if the email is verified for a different participant
- EmailNotOnFile – if the email address is not on file for any of the packages
- TooManyEmailAddresses – if the participant already has 10 emails
- Throttled – if the participant adds too many emails too quickly
validate_email_verification_request(c, email, *packages)¶
Given a cursor, email, and packages, return
Get a link to complete an email verification workflow.
a URL by which to complete the verification process
Given a cursor and email address, return a verification nonce.
Set the primary email address for the participant.
Given an email address and a nonce as strings, return a three-tuple:
- a list of packages if
- a boolean indicating whether the participant’s PayPal address was
updated if applicable (
Given an email address, modify the database.
This is where we actually mark the email address as verified. Additionally, we clear out any competing claims to the same address.
get_email(address, cursor=None, and_lock=False)¶
Return a record for a single email address on file for this participant.
- address (unicode) – the email address for which to get a record
- cursor (Cursor) – a database cursor; if
None, we’ll use
- and_lock – if True, we will acquire a write-lock on the email record before returning
a database record (a named tuple)
Return a list of all email addresses on file for this participant.
Return a list of verified email addresses on file for this participant.
Remove the given email address from the participant’s account. Raises
CannotRemovePrimaryEmailif the address is primary. It’s a noop if the email address is not on file.
Given a language identifier, set it for the participant as their preferred language in which to receive email.