13044 honor allow_token_retreival

This commit is contained in:
Arthur 2023-07-24 18:11:23 +07:00
parent c018cd8864
commit a771061c45
2 changed files with 6 additions and 6 deletions

View File

@ -3,7 +3,7 @@
{% load helpers %}
{% load render_table from django_tables2 %}
{% block title %}{% trans "User" %} {{ object.key }}{% endblock %}
{% block title %}{% trans "Token" %} {{ object }}{% endblock %}
{% block subtitle %}{% endblock %}
@ -16,7 +16,7 @@
<table class="table table-hover attr-table">
<tr>
<th scope="row">{% trans "Key" %}</th>
<td>{{ object.key }}</td>
<td>{{ object }}</td>
</tr>
<tr>
<th scope="row">{% trans "User" %}</th>

View File

@ -1,3 +1,4 @@
from django.conf import settings
import django_tables2 as tables
from netbox.tables import NetBoxTable, columns
@ -59,7 +60,6 @@ class TokenTable(NetBoxTable):
class UserTokenTable(NetBoxTable):
key = columns.TemplateColumn(
template_code=TOKEN,
linkify=True,
)
write_enabled = columns.BooleanColumn(
verbose_name='Write'
@ -77,9 +77,9 @@ class UserTokenTable(NetBoxTable):
class Meta(NetBoxTable.Meta):
model = UserToken
fields = (
'pk', 'key', 'user', 'description', 'write_enabled', 'created', 'expires', 'last_used', 'allowed_ips',
)
fields = [
'pk', 'id', 'key', 'user', 'description', 'write_enabled', 'created', 'expires', 'last_used', 'allowed_ips',
]
class UserTable(NetBoxTable):