add field type in form
This commit is contained in:
parent
72a895a6de
commit
01bc21d1a4
|
@ -199,13 +199,13 @@ class DidRegisterView(MyWallet, CreateView):
|
||||||
icon = 'bi bi-patch-check-fill'
|
icon = 'bi bi-patch-check-fill'
|
||||||
wallet = True
|
wallet = True
|
||||||
model = DID
|
model = DID
|
||||||
fields = ('label',)
|
fields = ('label', 'type')
|
||||||
success_url = reverse_lazy('idhub:user_dids')
|
success_url = reverse_lazy('idhub:user_dids')
|
||||||
object = None
|
object = None
|
||||||
|
|
||||||
def form_valid(self, form):
|
def form_valid(self, form):
|
||||||
form.instance.user = self.request.user
|
form.instance.user = self.request.user
|
||||||
form.instance.set_did(form.instance.type)
|
form.instance.set_did()
|
||||||
form.save()
|
form.save()
|
||||||
messages.success(self.request, _('DID created successfully'))
|
messages.success(self.request, _('DID created successfully'))
|
||||||
|
|
||||||
|
|
|
@ -33,7 +33,9 @@ class LoginView(auth_views.LoginView):
|
||||||
|
|
||||||
|
|
||||||
def serve_did(request, did_id):
|
def serve_did(request, did_id):
|
||||||
document = get_object_or_404(DID, did=f'did:web:{settings.DOMAIN}:{did_id}').didweb_document
|
id_did = f'did:web:{settings.DOMAIN}:did-registry:{did_id}'
|
||||||
|
did = get_object_or_404(DID, did=id_did)
|
||||||
|
document = did.didweb_document
|
||||||
retval = HttpResponse(document)
|
retval = HttpResponse(document)
|
||||||
retval.headers["Content-Type"] = "application/json"
|
retval.headers["Content-Type"] = "application/json"
|
||||||
return retval
|
return retval
|
||||||
|
|
Loading…
Reference in a new issue