This commit is contained in:
Cayo Puigdefabregas 2023-10-31 17:07:43 +01:00
parent 898877709f
commit 734d7aab23
2 changed files with 5 additions and 11 deletions

View File

@ -53,11 +53,10 @@ class VerificableCredential(models.Model):
Definition of Verificable Credentials
"""
class Status(models.IntegerChoices):
ENABLE = 1, _("Enable")
REQUIRED = 2, _("Required")
DENEGATED = 3, _("Denegated")
ISSUED = 4, _("Issued")
REVOKED = 5, _("Revoked")
ENABLED = 1, _("Enabled")
REQUESTED = 2, _("Requested")
ISSUED = 3, _("Issued")
REVOKED = 4, _("Revoked")
EXPIRED = 6, _("Expired")
id_string = models.CharField(max_length=250)
@ -69,7 +68,7 @@ class VerificableCredential(models.Model):
data = models.TextField()
status = models.PositiveSmallIntegerField(
choices=Status.choices,
default=Status.ENABLE
default=Status.ENABLED
)
user = models.ForeignKey(
User,

View File

@ -13,11 +13,6 @@
{% if object.get_status == 'Issued' %}
<a class="btn btn-yellow" href="{% url 'idhub:user_credential_json' object.id %}">{% trans 'Revoke' %}</a>
<a class="btn btn-orange" href="{% url 'idhub:user_credential_json' object.id %}">{% trans 'Delete' %}</a>
{% elif object.get_status == 'Required' %}
<a class="btn btn-yellow" href="{% url 'idhub:user_credential_json' object.id %}">{% trans 'Accept' %}</a>
<a class="btn btn-orange" href="{% url 'idhub:user_credential_json' object.id %}">{% trans 'Deny' %}</a>
{% elif object.get_status == 'Issued' %}
<a class="btn btn-yellow" href="{% url 'idhub:user_credential_json' object.id %}">{% trans 'Revoke' %}</a>
{% endif %}
</div>
</div>