From 069b218828892d84213e9bf9edc1b30c1f805aa2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Jastrz=C4=99bski?= Date: Tue, 4 Jan 2022 08:52:39 +0100 Subject: [PATCH] Move api token info to security tab --- .../templates/account/password_change.html | 15 ++++++++++++-- shynet/dashboard/templates/base.html | 3 --- .../dashboard/pages/api_settings.html | 20 ------------------- shynet/dashboard/views.py | 2 +- 4 files changed, 14 insertions(+), 26 deletions(-) delete mode 100644 shynet/dashboard/templates/dashboard/pages/api_settings.html diff --git a/shynet/dashboard/templates/account/password_change.html b/shynet/dashboard/templates/account/password_change.html index ca8f276..2a68a1d 100644 --- a/shynet/dashboard/templates/account/password_change.html +++ b/shynet/dashboard/templates/account/password_change.html @@ -2,8 +2,8 @@ {% load i18n a17t_tags %} -{% block head_title %}{% trans "Change Password" %}{% endblock %} -{% block page_title %}{% trans "Change Password" %}{% endblock %} +{% block head_title %}{% trans "Change authentication info" %}{% endblock %} +{% block page_title %}{% trans "Change authentication info" %}{% endblock %} {% block card %}
@@ -11,4 +11,15 @@ {{ form|a17t }}
+
+
+

Personal API token

+
+ {{request.user.api_token}} + + + +
+
+ {% endblock %} diff --git a/shynet/dashboard/templates/base.html b/shynet/dashboard/templates/base.html index 113d602..f4d2f67 100644 --- a/shynet/dashboard/templates/base.html +++ b/shynet/dashboard/templates/base.html @@ -88,9 +88,6 @@ {% url 'account_set_password' as url %} {% include 'dashboard/includes/sidebar_portal.html' with label="Security" url=url %} - {% url 'dashboard:api_settings' as url %} - {% include 'dashboard/includes/sidebar_portal.html' with label="API" url=url %} - {% url 'account_logout' as url %} {% include 'dashboard/includes/sidebar_portal.html' with label="Sign Out" url=url %} diff --git a/shynet/dashboard/templates/dashboard/pages/api_settings.html b/shynet/dashboard/templates/dashboard/pages/api_settings.html deleted file mode 100644 index b242766..0000000 --- a/shynet/dashboard/templates/dashboard/pages/api_settings.html +++ /dev/null @@ -1,20 +0,0 @@ -{% extends "base.html" %} - -{% block content %} -
-

API

-
-
-
-

Token

-
- {{request.user.api_token}} - - - -
-
-
-
-
-{% endblock %} diff --git a/shynet/dashboard/views.py b/shynet/dashboard/views.py index 96a59a8..080e05d 100644 --- a/shynet/dashboard/views.py +++ b/shynet/dashboard/views.py @@ -165,4 +165,4 @@ class RefreshApiTokenView(LoginRequiredMixin, View): def get(self, request): request.user.api_token = _default_api_token() request.user.save() - return redirect('dashboard:api_settings') + return redirect('account_change_password')