add interface for create tokens by user for user
This commit is contained in:
parent
a1ffdb5ed6
commit
2f4a85f79b
|
@ -98,7 +98,6 @@ class TokenDeleteView(DashboardView, DeleteView):
|
|||
model = Token
|
||||
|
||||
def get(self, request, *args, **kwargs):
|
||||
# self.check_valid_user()
|
||||
self.pk = kwargs['pk']
|
||||
self.object = get_object_or_404(self.model, pk=self.pk)
|
||||
self.object.delete()
|
||||
|
@ -109,8 +108,7 @@ class TokenDeleteView(DashboardView, DeleteView):
|
|||
class TokenNewView(DashboardView, View):
|
||||
|
||||
def get(self, request, *args, **kwargs):
|
||||
# self.check_valid_user()
|
||||
Token.objects.create(token=uuid4())
|
||||
Token.objects.create(token=uuid4(), owner=self.request.user)
|
||||
|
||||
return redirect('api:tokens')
|
||||
|
||||
|
|
|
@ -144,7 +144,7 @@
|
|||
</ul>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link fw-bold" href="{# url 'api:tokens' #}">
|
||||
<a class="nav-link fw-bold" href="{% url 'api:tokens' %}">
|
||||
<i class="bi-menu-button-wide icon_sidebar"></i>
|
||||
{% trans 'Tokens' %}
|
||||
</a>
|
||||
|
|
Loading…
Reference in a new issue