user-panel #9
|
@ -98,7 +98,6 @@ class TokenDeleteView(DashboardView, DeleteView):
|
||||||
model = Token
|
model = Token
|
||||||
|
|
||||||
def get(self, request, *args, **kwargs):
|
def get(self, request, *args, **kwargs):
|
||||||
# self.check_valid_user()
|
|
||||||
self.pk = kwargs['pk']
|
self.pk = kwargs['pk']
|
||||||
self.object = get_object_or_404(self.model, pk=self.pk)
|
self.object = get_object_or_404(self.model, pk=self.pk)
|
||||||
self.object.delete()
|
self.object.delete()
|
||||||
|
@ -109,8 +108,7 @@ class TokenDeleteView(DashboardView, DeleteView):
|
||||||
class TokenNewView(DashboardView, View):
|
class TokenNewView(DashboardView, View):
|
||||||
|
|
||||||
def get(self, request, *args, **kwargs):
|
def get(self, request, *args, **kwargs):
|
||||||
# self.check_valid_user()
|
Token.objects.create(token=uuid4(), owner=self.request.user)
|
||||||
Token.objects.create(token=uuid4())
|
|
||||||
|
|
||||||
return redirect('api:tokens')
|
return redirect('api:tokens')
|
||||||
|
|
||||||
|
|
|
@ -144,7 +144,7 @@
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item">
|
<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>
|
<i class="bi-menu-button-wide icon_sidebar"></i>
|
||||||
{% trans 'Tokens' %}
|
{% trans 'Tokens' %}
|
||||||
</a>
|
</a>
|
||||||
|
|
Loading…
Reference in a new issue