From c34388e6c9d08f7974f36407444716f07c79dc5b Mon Sep 17 00:00:00 2001 From: "R. Miles McCain" Date: Thu, 15 Sep 2022 22:24:29 -0700 Subject: [PATCH] Fix migrations --- shynet/core/migrations/0009_auto_20211117_0217.py | 2 +- .../templates/account/password_change.html | 14 ++++++++++++-- .../templates/dashboard/pages/service_update.html | 2 +- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/shynet/core/migrations/0009_auto_20211117_0217.py b/shynet/core/migrations/0009_auto_20211117_0217.py index 461cd1e..417774c 100644 --- a/shynet/core/migrations/0009_auto_20211117_0217.py +++ b/shynet/core/migrations/0009_auto_20211117_0217.py @@ -14,7 +14,7 @@ class Migration(migrations.Migration): migrations.AddField( model_name='user', name='api_token', - field=models.TextField(default=core.models._default_api_token, unique=True), + field=models.TextField(null=True, unique=True), ), migrations.AlterField( model_name='user', diff --git a/shynet/dashboard/templates/account/password_change.html b/shynet/dashboard/templates/account/password_change.html index 3fe2bbf..b7a595a 100644 --- a/shynet/dashboard/templates/account/password_change.html +++ b/shynet/dashboard/templates/account/password_change.html @@ -15,10 +15,20 @@

Personal API token

+ {% if request.user.api_token %} {{request.user.api_token}} + {% else %} + Token not generated + {% endif %}
- {% csrf_token %} - + {% csrf_token %} +

To learn more about the API, see our API guide.

diff --git a/shynet/dashboard/templates/dashboard/pages/service_update.html b/shynet/dashboard/templates/dashboard/pages/service_update.html index a8913e3..61f72b7 100644 --- a/shynet/dashboard/templates/dashboard/pages/service_update.html +++ b/shynet/dashboard/templates/dashboard/pages/service_update.html @@ -47,7 +47,7 @@

Example using cURL:

- curl -H 'Authorization: Token {{request.user.api_token}}' '{{script_protocol}}{{request.get_host}}{% url 'api:services' %}?uuid={{object.uuid}}&startDate=2021-01-01&endDate=2050-01-01' + curl -H 'Authorization: Token (your API token, available on security page)' '{{script_protocol}}{{request.get_host}}{% url 'api:services' %}?uuid={{object.uuid}}&startDate=2021-01-01&endDate=2050-01-01'
{% endblock %}