add did for manual new user
This commit is contained in:
parent
c4049d966b
commit
a44a5b170f
|
@ -283,7 +283,11 @@ class PeopleRegisterView(NotifyActivateUserByEmail, People, CreateView):
|
||||||
return self.success_url
|
return self.success_url
|
||||||
|
|
||||||
def form_valid(self, form):
|
def form_valid(self, form):
|
||||||
user = form.save()
|
super().form_valid(form)
|
||||||
|
user = form.instance
|
||||||
|
user.set_encrypted_sensitive_data()
|
||||||
|
user.save()
|
||||||
|
self.create_defaults_dids(user)
|
||||||
messages.success(self.request, _('The account was created successfully'))
|
messages.success(self.request, _('The account was created successfully'))
|
||||||
Event.set_EV_USR_REGISTERED(user)
|
Event.set_EV_USR_REGISTERED(user)
|
||||||
Event.set_EV_USR_WELCOME(user)
|
Event.set_EV_USR_WELCOME(user)
|
||||||
|
@ -295,6 +299,11 @@ class PeopleRegisterView(NotifyActivateUserByEmail, People, CreateView):
|
||||||
messages.error(self.request, e)
|
messages.error(self.request, e)
|
||||||
return super().form_valid(form)
|
return super().form_valid(form)
|
||||||
|
|
||||||
|
def create_defaults_dids(self, user):
|
||||||
|
did = DID(label="Default", user=user, type=DID.Types.WEB)
|
||||||
|
did.set_did()
|
||||||
|
did.save()
|
||||||
|
|
||||||
|
|
||||||
class PeopleMembershipRegisterView(People, FormView):
|
class PeopleMembershipRegisterView(People, FormView):
|
||||||
template_name = "idhub/admin/people_membership_register.html"
|
template_name = "idhub/admin/people_membership_register.html"
|
||||||
|
|
Loading…
Reference in New Issue