From ac88bd5d44af1df8946a7ca50583dfe581de10f8 Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Mon, 5 Oct 2020 22:40:30 +0200 Subject: [PATCH] core: hide token value by default --- passbook/admin/templates/administration/token/list.html | 6 ++---- passbook/admin/views/tokens.py | 1 + passbook/core/models.py | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/passbook/admin/templates/administration/token/list.html b/passbook/admin/templates/administration/token/list.html index fcf0becd7..e2a43e4d5 100644 --- a/passbook/admin/templates/administration/token/list.html +++ b/passbook/admin/templates/administration/token/list.html @@ -25,7 +25,7 @@ - + @@ -36,9 +36,7 @@ {% for token in object_list %}
{% trans 'Token' %}{% trans 'Identifier' %} {% trans 'User' %} {% trans 'Expires?' %} {% trans 'Expiry Date' %}
-
-
{{ token.pk.hex }}
-
+
{{ token.identifier }}
diff --git a/passbook/admin/views/tokens.py b/passbook/admin/views/tokens.py index 65014e0e6..86e26df3a 100644 --- a/passbook/admin/views/tokens.py +++ b/passbook/admin/views/tokens.py @@ -27,6 +27,7 @@ class TokenListView( ordering = "expires" template_name = "administration/token/list.html" search_fields = [ + "identifier", "intent", "user__username", "description", diff --git a/passbook/core/models.py b/passbook/core/models.py index dae7a07f8..dac0b3ede 100644 --- a/passbook/core/models.py +++ b/passbook/core/models.py @@ -314,7 +314,7 @@ class Token(ExpiringModel): def __str__(self): return ( - f"Token {self.token_uuid.hex} {self.description} (expires={self.expires})" + f"Token {self.identifier} (expires={self.expires})" ) class Meta: