akvo.rsr.views.account module
Akvo RSR is covered by the GNU Affero General Public License.
See more details in the license.txt file located at the root folder of the Akvo RSR module. For additional details on the GNU license please see < http://www.gnu.org/licenses/agpl.html >.
- class akvo.rsr.views.account.DisableTwoFactorView(**kwargs)[source]
Bases:
DisableView
- success_url = '/my-rsr/my-details/'
- class akvo.rsr.views.account.SetupTwoFactorView(**kwargs)[source]
Bases:
SetupView
- get_context_data(form, **kwargs)[source]
Returns the template context for a step. You can overwrite this method to add more data for all or some steps. This method returns a dictionary containing the rendered form step. Available template context variables are:
all extra data stored in the storage backend
wizard - a dictionary representation of the wizard instance
Example:
class MyWizard(WizardView): def get_context_data(self, form, **kwargs): context = super().get_context_data(form=form, **kwargs) if self.steps.current == 'my_step_name': context.update({'another_var': True}) return context
- number_of_tokens = 10
- success_url = 'two_factor:backup_tokens'
- class akvo.rsr.views.account.SignInView(**kwargs)[source]
Bases:
LoginView
- PASSWORD_STEP = 'password'
- condition_dict = {'backup': <function LoginView.has_backup_step>, 'password': <function SignInView.has_password_step>, 'token': <function LoginView.has_token_step>}
- form_list = (('auth', <class 'django.contrib.auth.forms.AuthenticationForm'>), ('token', <class 'two_factor.forms.AuthenticationTokenForm'>), ('backup', <class 'two_factor.forms.BackupTokenForm'>), ('password', <class 'django.contrib.auth.forms.PasswordChangeForm'>))
- class akvo.rsr.views.account.TwoFactorBackupTokensView(**kwargs)[source]
Bases:
RedirectURLMixin
,BackupTokensView
- akvo.rsr.views.account.activate(request, activation_key, extra_context=None)[source]
Activate resouce.
Activate a User’s account, if their key is valid and hasn’t expired. Any values passed in the keyword argument “extra_context” (which must be a dictionary) will be added to the context. Any values in “extra_context” which are callable will be called prior to being added to the context.
- akvo.rsr.views.account.api_key(request)[source]
On successful user credentials returns an auth token for API usage.
Since RSR changed in v3 to allow users without an organisation we need to introduce a way to make old Up apps work as before but new ones support users without any connected organisations.
- akvo.rsr.views.account.api_key_json_response(user, orgs)[source]
Build the JSON response. This is used by the Up app - so make sure they match on change.
- akvo.rsr.views.account.api_key_xml_response(user, orgs)[source]
Build the XML response.
This is used by the Up app - so make sure they match on change.
- akvo.rsr.views.account.invite_activate(request, inviting_pk, user_pk, employment_pk, token_date, token)[source]
Activate a user that has been invited to use RSR.
- Parameters:
request – the request
inviting_pk – the invitee user’s primary key
user_pk – the invited user’s primary key
employment_pk – the employment’s primary key
token_date – the first part of the token
token – the second part of the token