thunderbird_accounts.authentication.models

Classes

User(*args, **kwargs)

UserSession(*args, **kwargs)

User Session, mirrors the db cache for eventually showing the user which sessions they're logged into.

class thunderbird_accounts.authentication.models.UserSession(*args, **kwargs)[source]

Bases: BaseModel

User Session, mirrors the db cache for eventually showing the user which sessions they’re logged into. :param user: The session’s related user :param session_key: The session id/key the user logged in with

Parameters:
  • uuid (UUIDField) – Primary key: Uuid

  • created_at (DateTimeField) – Created at

  • updated_at (DateTimeField) – Updated at

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

class thunderbird_accounts.authentication.models.User(*args, **kwargs)[source]

Bases: AbstractUser, BaseModel

Parameters:
  • fxa_id – The ID of the connected firefox account

  • last_used_email – The last used email associated with firefox account

  • language – The user’s preferred language to view the ui/system emails in

  • display_name – Display name from FxA profile

  • avatar_url – Avatar URL from FxA profile

  • timezone – The user’s timezone

  • password (CharField) – Password

  • last_login (DateTimeField) – Last login

  • is_superuser (BooleanField) – Superuser status. Designates that this user has all permissions without explicitly assigning them.

  • username (CharField) – Username. Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.

  • first_name (CharField) – First name

  • last_name (CharField) – Last name

  • email (EmailField) – Email address

  • is_staff (BooleanField) – Staff status. Designates whether the user can log into this admin site.

  • is_active (BooleanField) – Active. Designates whether this user should be treated as active. Unselect this instead of deleting accounts.

  • date_joined (DateTimeField) – Date joined

  • uuid (UUIDField) – Primary key: Uuid

  • created_at (DateTimeField) – Created at

  • updated_at (DateTimeField) – Updated at

  • _fxa_token (BinaryField) – fxa token

Relationship fields:

Parameters:
  • groups (ManyToManyField to Group) – Groups. The groups this user belongs to. A user will get all permissions granted to each of their groups. (related name: user_set)

  • user_permissions (ManyToManyField to Permission) – User permissions. Specific permissions for this user. (related name: user_set)

Reverse relationships:

Parameters:
  • usersession (Reverse ForeignKey from UserSession) – All user sessions of this user (related name of user)

  • customer (Reverse ForeignKey from Customer) – All customers of this user (related name of user)

  • account (Reverse ForeignKey from Account) – All accounts of this user (related name of django_user)

  • logentry (Reverse ForeignKey from LogEntry) – All log entries of this user (related name of user)

class UserLanguageType(*values)[source]

Bases: TextChoices

has_usable_password()[source]

Disable passwords for fxa

exception DoesNotExist

Bases: ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: MultipleObjectsReturned

get_short_name()[source]

Return the short name for the user.