rename revoke to delete to be clearer

This commit is contained in:
Ariel Rin 2022-10-12 20:22:20 +10:00
parent 6b8341ab5a
commit 90ad7790e1
3 changed files with 8 additions and 10 deletions

View File

@ -9,9 +9,9 @@
<table class="table table-aa" id="table_tokens" style="width:100%">
<thead>
<tr>
<th>Scopes</th>
<th class="text-right">Actions</th>
<th>Character</th>
<th>{% translate "Scoes" %}</th>
<th class="text-right">{% translate "Actions" %}</th>
<th>{% translate "Character" %}</th>
</tr>
</thead>
@ -19,7 +19,7 @@
{% for t in tokens %}
<tr>
<td styl="white-space:initial;">{% for s in t.scopes.all %}<span class="label label-default">{{s.name}}</span> {% endfor %}</td>
<td class="text-right"><a href="{% url 'authentication:token_revoke' t.id %}" class="btn btn-danger"><i class="fas fa-trash"></i></a> <a href="{% url 'authentication:token_refresh' t.id %}" class="btn btn-success"><i class="fas fa-sync-alt"></i></a></td>
<td class="text-right"><a href="{% url 'authentication:token_delete' t.id %}" class="btn btn-danger"><i class="fas fa-trash"></i></a> <a href="{% url 'authentication:token_refresh' t.id %}" class="btn btn-success"><i class="fas fa-sync-alt"></i></a></td>
<td>{{t.character_name}}</td>
</tr>
{% endfor %}

View File

@ -28,9 +28,9 @@ urlpatterns = [
name='token_management'
),
path(
'account/tokens/revoke/<int:token_id>',
views.token_revoke,
name='token_revoke'
'account/tokens/delete/<int:token_id>',
views.token_delete,
name='token_delete'
),
path(
'account/tokens/refresh/<int:token_id>',

View File

@ -1,6 +1,4 @@
from glob import escape
import logging
from symbol import except_clause
from django.conf import settings
from django.contrib import messages
@ -73,7 +71,7 @@ def token_management(request):
return render(request, 'authentication/tokens.html', context)
@login_required
def token_revoke(request, token_id=None):
def token_delete(request, token_id=None):
try:
token = Token.objects.get(id=token_id)
if request.user == token.user: