Jump to >

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.

form_id = u’settings’[source]
form_title = _(u’Settings’)[source]
save_label = _(u’Save Settings’)[source]
load()[source]

Load data for the form.

save()[source]

Save the form.

class APITokensForm(page, request, user, *args, **kwargs)[source]

Bases: reviewboard.accounts.forms.pages.AccountPageForm

Form for showing a user’s API tokens.

form_id = u’api_tokens’[source]
form_title = _(u’API Tokens’)[source]
save_label = None[source]
js_view_class = u’RB.APITokensView’[source]
get_js_view_data()[source]

Get data to pass to the JavaScript view.

class ChangePasswordForm(page, request, user, *args, **kwargs)[source]

Bases: reviewboard.accounts.forms.pages.AccountPageForm

Form for changing a user’s password.

form_id = u’change_password’[source]
form_title = _(u’Change Password’)[source]
save_label = _(u’Change Password’)[source]
is_visible()[source]

Get whether or not the “change password” form should be shown.

clean_old_password()[source]

Validate the ‘old_password’ field.

This checks to make sure the old password is correct when changing the password.

clean_password2()[source]

Validate the ‘password2’ field.

This makes sure that the two password fields match.

save()[source]

Save the form.

class ProfileForm(page, request, user, *args, **kwargs)[source]

Bases: reviewboard.accounts.forms.pages.AccountPageForm

Form for the Profile page for an account.

form_id = u’profile’[source]
form_title = _(u’Profile’)[source]
save_label = _(u’Save Profile’)[source]
load()[source]

Load data for the form.

save()[source]

Save the form.

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.

form_id = u’groups’[source]
form_title = _(u’Groups’)[source]
save_label = None[source]
js_view_class = u’RB.JoinedGroupsView’[source]
get_js_view_data()[source]

Get data to pass to the JavaScript view.