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%"> <table class="table table-aa" id="table_tokens" style="width:100%">
<thead> <thead>
<tr> <tr>
<th>Scopes</th> <th>{% translate "Scoes" %}</th>
<th class="text-right">Actions</th> <th class="text-right">{% translate "Actions" %}</th>
<th>Character</th> <th>{% translate "Character" %}</th>
</tr> </tr>
</thead> </thead>
@ -19,7 +19,7 @@
{% for t in tokens %} {% for t in tokens %}
<tr> <tr>
<td styl="white-space:initial;">{% for s in t.scopes.all %}<span class="label label-default">{{s.name}}</span> {% endfor %}</td> <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> <td>{{t.character_name}}</td>
</tr> </tr>
{% endfor %} {% endfor %}

View File

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

View File

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