reviewboard.accounts.forms.pages¶
-
class
AccountPageForm
(page, request, user, *args, **kwargs)[source]¶ Bases:
djblets.configforms.forms.ConfigPageForm
Base class for a form on the My Account page.
AccountPageForms belong to AccountPages, and will be displayed on the My Account page for a user.
A simple form presents fields that can be filled out and posted. More advanced forms can supply their own template or even their own JavaScript models and views.
-
class
AccountSettingsForm
(page, request, user, *args, **kwargs)[source]¶ Bases:
reviewboard.accounts.forms.pages.AccountPageForm
Form for the Settings page for an account.
-
class
AvatarSettingsForm
(*args, **kwargs)[source]¶ Bases:
djblets.avatars.forms.AvatarSettingsForm
A form for configuring the avatar for a user.
This form will only be shown when avatars are enabled for the server.
-
class
APITokensForm
(page, request, user, *args, **kwargs)[source]¶ Bases:
reviewboard.accounts.forms.pages.AccountPageForm
Form for showing a user’s API tokens.
-
class
ChangePasswordForm
(page, request, user, *args, **kwargs)[source]¶ Bases:
reviewboard.accounts.forms.pages.AccountPageForm
Form for changing a user’s password.
-
is_visible
()[source]¶ Return whether or not the “change password” form should be shown.
Returns: Whether or not the form will be rendered. Return type: bool
-
clean_old_password
()[source]¶ Validate the ‘old_password’ field.
This checks to make sure the old password is correct when changing the password.
-
-
class
ProfileForm
(page, request, user, *args, **kwargs)[source]¶ Bases:
reviewboard.accounts.forms.pages.AccountPageForm
Form for the Profile page for an account.
-
class
GroupsForm
(page, request, user, *args, **kwargs)[source]¶ Bases:
reviewboard.accounts.forms.pages.AccountPageForm
Form for the group membership page.
Unlike most forms, this doesn’t deal with fields or saving to the database. Instead, it sets up the JavaScript View and provides serialized data representing the groups. The View handles group membership through the API.
-
class
OAuthApplicationsForm
(page, request, user, *args, **kwargs)[source]¶ Bases:
reviewboard.accounts.forms.pages.AccountPageForm
The OAuth Application form.
This provides a list of all current OAuth2 applications the user has access to.
-
class
OAuthTokensForm
(page, request, user, *args, **kwargs)[source]¶ Bases:
reviewboard.accounts.forms.pages.AccountPageForm
The OAuth Token form
This provides a list of all current OAuth2 tokens the user has created.
-
class
PrivacyForm
(*args, **kwargs)[source]¶ Bases:
djblets.privacy.consent.forms.ConsentConfigPageFormMixin
,reviewboard.accounts.forms.pages.AccountPageForm
A form for displaying privacy information and gathering consent.
This will display a user’s privacy rights, link to any configured Privacy Policy document, and display a form for gathering consent for features that make use of the user’s personally identifying information.
-
__init__
(*args, **kwargs)[source]¶ Initialize the form.
Parameters: - *args (tuple) – Positional arguments to pass to the parent form.
- **kwargs (dict) – Keyword arguments to pass to the parent form.
-
load
()[source]¶ Load the form data.
If a
?next
query argument is provided, it will be loaded into the initial value for thenext_url
so that it will persist through page submission.
-
is_visible
()[source]¶ Return whether or not the form should be rendered.
This will check if there’s any information to display in this form. It’s only displayed if consent requirements are enabled or there’s any privacy information configured in Admin Settings.
- Returns
- bool: Whether or not the form should be rendered.
-
get_extra_context
()[source]¶ Return extra context for the template.
Returns: Context used for rendering the form’s template. Return type: dict
-
clean_next_url
()[source]¶ Clean the next_url field.
Returns: The URL to redirect to, if any. Return type: unicode
-
save
()[source]¶ Save the privacy form.
This may redirect the user to the next URL if it is specified.
Returns: A redirect to the next URL if given and None
otherwise.Return type: django.http.HttpResponseRedirect
-