From d068c965592ba645d8d297ec0f6e9c6805d4fb9c Mon Sep 17 00:00:00 2001 From: Cefin Date: Fri, 3 Dec 2021 13:08:52 +0000 Subject: rapid action on person record add account #5216 part one --- ishtar_common/views.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'ishtar_common/views.py') diff --git a/ishtar_common/views.py b/ishtar_common/views.py index 6f5953841..5b67f1bcb 100644 --- a/ishtar_common/views.py +++ b/ishtar_common/views.py @@ -319,6 +319,12 @@ account_management_wizard = wizards.AccountWizard.as_view( url_name="account_management", ) +account_creation_wizard = wizards.AccountWizard.as_view( + account_wizard_steps, + label=_("Account creation"), + url_name="account_creation", +) + account_deletion_wizard = wizards.IshtarUserDeletionWizard.as_view( [ ("selec-account_deletion", forms.AccountFormSelection), @@ -328,6 +334,16 @@ account_deletion_wizard = wizards.IshtarUserDeletionWizard.as_view( url_name="account_deletion", ) +def account_create(request, pk): + if not wizard_is_available(account_creation_wizard, request, models.IshtarUser): + return HttpResponseRedirect("/") + wizards.AccountWizard.session_set_value( + request, "selec-account_management", "pk", pk, reset=True + ) + return redirect( + reverse("account_creation", kwargs={"step": "account-account_management"}) + ) + def get_autocomplete_generic(model, extra=None): if not extra: -- cgit v1.2.3