From 5a2e6565362d033d6a79e21c307564fc4ffce3b6 Mon Sep 17 00:00:00 2001 From: Elijah Date: Thu, 14 Dec 2023 19:38:00 +0100 Subject: [PATCH] Corrected small description bug in user credentials table --- .../0002_verificablecredential_description.py | 17 +++++++++++++++++ idhub/user/tables.py | 7 +++++++ 2 files changed, 24 insertions(+) create mode 100644 idhub/migrations/0002_verificablecredential_description.py diff --git a/idhub/migrations/0002_verificablecredential_description.py b/idhub/migrations/0002_verificablecredential_description.py new file mode 100644 index 0000000..21bd095 --- /dev/null +++ b/idhub/migrations/0002_verificablecredential_description.py @@ -0,0 +1,17 @@ +# Generated by Django 4.2.5 on 2023-12-09 16:51 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + dependencies = [ + ('idhub', '0001_initial'), + ] + + operations = [ + migrations.AddField( + model_name='verificablecredential', + name='description', + field=models.TextField(null=True), + ), + ] diff --git a/idhub/user/tables.py b/idhub/user/tables.py index a8856aa..55ca217 100644 --- a/idhub/user/tables.py +++ b/idhub/user/tables.py @@ -117,6 +117,13 @@ class CredentialsTable(tables.Table): def render_status(self, record): return record.get_status() + def order_type(self, queryset, is_descending): + queryset = queryset.order_by( + ("-" if is_descending else "") + "schema__type" + ) + + return (queryset, True) + class Meta: model = VerificableCredential template_name = "idhub/custom_table.html"