diff --git a/idhub/admin/views.py b/idhub/admin/views.py index 35c7f9c..e1c0fef 100644 --- a/idhub/admin/views.py +++ b/idhub/admin/views.py @@ -460,7 +460,7 @@ class AdminDidRegisterView(Credentials, CreateView): return form def form_valid(self, form): - user = form.save() + form.save() messages.success(self.request, _('DID created successfully')) return super().form_valid(form) @@ -487,7 +487,7 @@ class AdminDidEditView(Credentials, UpdateView): def form_valid(self, form): user = form.save() - messages.success(self.request, _('DID created successfully')) + messages.success(self.request, _('DID updated successfully')) return super().form_valid(form) @@ -499,10 +499,10 @@ class AdminDidDeleteView(Credentials, DeleteView): success_url = reverse_lazy('idhub:admin_dids') def get(self, request, *args, **kwargs): - # import pdb; pdb.set_trace() self.pk = kwargs['pk'] self.object = get_object_or_404(self.model, pk=self.pk) self.object.delete() + messages.success(self.request, _('DID delete successfully')) return redirect(self.success_url) diff --git a/idhub/models.py b/idhub/models.py index 52f3010..f58f1a2 100644 --- a/idhub/models.py +++ b/idhub/models.py @@ -152,7 +152,7 @@ class Service(models.Model): return ", ".join([x.name for x in self.rol.all()]) def __str__(self): - return "{} -> {}".format(self.domain, self.rol.name) + return "{} -> {}".format(self.domain, self.get_roles()) class UserRol(models.Model): diff --git a/idhub/templates/idhub/admin/dids.html b/idhub/templates/idhub/admin/dids.html index b7156c0..00765af 100644 --- a/idhub/templates/idhub/admin/dids.html +++ b/idhub/templates/idhub/admin/dids.html @@ -43,11 +43,11 @@