core: hide token value by default

This commit is contained in:
Jens Langhammer 2020-10-05 22:40:30 +02:00
parent 2406a619df
commit ac88bd5d44
3 changed files with 4 additions and 5 deletions

View File

@ -25,7 +25,7 @@
<table class="pf-c-table pf-m-compact pf-m-grid-xl" role="grid"> <table class="pf-c-table pf-m-compact pf-m-grid-xl" role="grid">
<thead> <thead>
<tr role="row"> <tr role="row">
<th role="columnheader" scope="col">{% trans 'Token' %}</th> <th role="columnheader" scope="col">{% trans 'Identifier' %}</th>
<th role="columnheader" scope="col">{% trans 'User' %}</th> <th role="columnheader" scope="col">{% trans 'User' %}</th>
<th role="columnheader" scope="col">{% trans 'Expires?' %}</th> <th role="columnheader" scope="col">{% trans 'Expires?' %}</th>
<th role="columnheader" scope="col">{% trans 'Expiry Date' %}</th> <th role="columnheader" scope="col">{% trans 'Expiry Date' %}</th>
@ -36,9 +36,7 @@
{% for token in object_list %} {% for token in object_list %}
<tr role="row"> <tr role="row">
<th role="columnheader"> <th role="columnheader">
<div> <div>{{ token.identifier }}</div>
<div>{{ token.pk.hex }}</div>
</div>
</th> </th>
<td role="cell"> <td role="cell">
<span> <span>

View File

@ -27,6 +27,7 @@ class TokenListView(
ordering = "expires" ordering = "expires"
template_name = "administration/token/list.html" template_name = "administration/token/list.html"
search_fields = [ search_fields = [
"identifier",
"intent", "intent",
"user__username", "user__username",
"description", "description",

View File

@ -314,7 +314,7 @@ class Token(ExpiringModel):
def __str__(self): def __str__(self):
return ( return (
f"Token {self.token_uuid.hex} {self.description} (expires={self.expires})" f"Token {self.identifier} (expires={self.expires})"
) )
class Meta: class Meta: