diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 17ac192..719f637 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -21,9 +21,9 @@ repos: - id: end-of-file-fixer - id: mixed-line-ending - id: name-tests-test - args: [--pytest-test-first] + args: [ --pytest-test-first ] - id: trailing-whitespace - args: [--markdown-linebreak-ext=md] + args: [ --markdown-linebreak-ext=md ] exclude_types: - "html" @@ -32,22 +32,22 @@ repos: rev: "1.19.0" hooks: - id: django-upgrade - args: [--target-version, "5.1"] + args: [ --target-version, "5.1" ] # Run Pyupgrade on all Python files. This will upgrade the code to Python 3.12. - repo: https://github.com/asottile/pyupgrade rev: v3.16.0 hooks: - id: pyupgrade - args: ["--py312-plus"] + args: [ "--py312-plus" ] # An extremely fast Python linter and formatter. - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.5.0 + rev: v0.5.1 hooks: - id: ruff-format - id: ruff - args: ["--fix", "--exit-non-zero-on-fix"] + args: [ "--fix", "--exit-non-zero-on-fix" ] # Static checker for GitHub Actions workflow files. - repo: https://github.com/rhysd/actionlint diff --git a/.vscode/launch.json b/.vscode/launch.json index 5a6793f..57f15e3 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -1,28 +1,28 @@ { - "version": "0.2.0", - "configurations": [ - { - "name": "Django: Runserver", - "type": "debugpy", - "request": "launch", - "program": "${workspaceFolder}/manage.py", - "args": [ - "runserver", - "--nothreading" - ], - "django": true, - "justMyCode": true - }, - { - "name": "python manage.py scrape_twitch", - "type": "debugpy", - "request": "launch", - "program": "${workspaceFolder}/manage.py", - "args": [ - "scrape_twitch" - ], - "django": true, - "justMyCode": true - } - ] + "version": "0.2.0", + "configurations": [ + { + "name": "Django: Runserver", + "type": "debugpy", + "request": "launch", + "program": "${workspaceFolder}/manage.py", + "args": [ + "runserver", + "--nothreading" + ], + "django": true, + "justMyCode": true + }, + { + "name": "python manage.py scrape_twitch", + "type": "debugpy", + "request": "launch", + "program": "${workspaceFolder}/manage.py", + "args": [ + "scrape_twitch" + ], + "django": true, + "justMyCode": true + } + ] } diff --git a/.vscode/settings.json b/.vscode/settings.json index 46c826d..cab6e41 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,17 +1,17 @@ { - "cSpell.words": [ - "allauth", - "appendonly", - "asgiref", - "forloop", - "logdir", - "memlock", - "networkidle", - "PGID", - "PUID", - "requirepass", - "socialaccount", - "ttvdrops", - "ulimits" - ] + "cSpell.words": [ + "allauth", + "appendonly", + "asgiref", + "forloop", + "logdir", + "memlock", + "networkidle", + "PGID", + "PUID", + "requirepass", + "socialaccount", + "ttvdrops", + "ulimits" + ] } diff --git a/config/settings.py b/config/settings.py index b0cd681..760d9a5 100644 --- a/config/settings.py +++ b/config/settings.py @@ -8,7 +8,6 @@ from platformdirs import user_data_dir load_dotenv(dotenv_path=find_dotenv(), verbose=True) - DATA_DIR = Path( user_data_dir( appname="TTVDrops", @@ -28,7 +27,6 @@ sentry_sdk.init( profiles_sample_rate=0.2, ) - BASE_DIR: Path = Path(__file__).resolve().parent.parent ADMINS: list[tuple[str, str]] = [("Joakim Hellsén", "tlovinator@gmail.com")] WSGI_APPLICATION = "config.wsgi.application" @@ -89,7 +87,6 @@ MIDDLEWARE: list[str] = [ "simple_history.middleware.HistoryRequestMiddleware", ] - TEMPLATES = [ { "BACKEND": "django.template.backends.django.DjangoTemplates", diff --git a/core/templates/index.html b/core/templates/index.html index f8f9632..dab9a4c 100644 --- a/core/templates/index.html +++ b/core/templates/index.html @@ -107,16 +107,16 @@ {% endblock content %} diff --git a/core/templates/webhooks.html b/core/templates/webhooks.html index b3301c6..6c44040 100644 --- a/core/templates/webhooks.html +++ b/core/templates/webhooks.html @@ -2,22 +2,27 @@ {% block content %}

Add Discord Webhook

-
- {% csrf_token %} - {{ form.non_field_errors }} -
- {{ form.webhook_url.errors }} - - -
{{ form.webhook_url.help_text }}
-
- -
+
+ Webhooks will be saved in a cookie and will be sent to the server when you subscribe to a drop. +
+
+
+ {% csrf_token %} + {{ form.non_field_errors }} +
+ {{ form.webhook_url.errors }} + + +
{{ form.webhook_url.help_text }}
+
+ +
+

Webhooks

{% if webhooks %}