From e250a2bf48d8f7e724172abd9d7782fabb7ad808 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 13 Nov 2023 17:59:09 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- voxpop/migrations/0008_alter_voxpop_allow_anonymous.py | 9 ++++----- voxpop/signals.py | 4 ++-- voxpop/static/admin.js | 2 +- voxpop/static/voxpop.css | 2 +- voxpop/views.py | 4 ++-- 5 files changed, 10 insertions(+), 11 deletions(-) diff --git a/voxpop/migrations/0008_alter_voxpop_allow_anonymous.py b/voxpop/migrations/0008_alter_voxpop_allow_anonymous.py index f0747be..9c0fdc2 100644 --- a/voxpop/migrations/0008_alter_voxpop_allow_anonymous.py +++ b/voxpop/migrations/0008_alter_voxpop_allow_anonymous.py @@ -4,15 +4,14 @@ class Migration(migrations.Migration): - dependencies = [ - ('voxpop', '0007_message_channel_name'), + ("voxpop", "0007_message_channel_name"), ] operations = [ migrations.AlterField( - model_name='voxpop', - name='allow_anonymous', - field=models.BooleanField(default=True, verbose_name='allow anonymous'), + model_name="voxpop", + name="allow_anonymous", + field=models.BooleanField(default=True, verbose_name="allow anonymous"), ), ] diff --git a/voxpop/signals.py b/voxpop/signals.py index 46e79f0..91211f8 100644 --- a/voxpop/signals.py +++ b/voxpop/signals.py @@ -64,12 +64,12 @@ def notify_question_state_changed(sender, instance, *args, **kwargs): @receiver(post_save, sender=Question) def notify_question_created(sender, instance, created, **kwargs): if created: - channel_name = get_notify_channel_name(voxpop_id=instance.voxpop_id) + channel_name = get_notify_channel_name(voxpop_id=instance.voxpop_id) payload = { "uuid": str(instance.uuid), "text": str(instance.text), "display_name": str(instance.display_name), - "created_at": str(instance.created_at), + "created_at": str(instance.created_at), } message = create_message( voxpop_id=instance.voxpop_id, diff --git a/voxpop/static/admin.js b/voxpop/static/admin.js index 7f83607..7b9f459 100644 --- a/voxpop/static/admin.js +++ b/voxpop/static/admin.js @@ -97,7 +97,7 @@ clone.querySelector("div[data-voxpop-question-uuid]").setAttribute("data-voxpop-question-uuid", question.uuid); clone.querySelector("blockquote").innerText = question.text; clone.querySelector(".displayName").innerText = question.display_name; - + // Format time. const datetime = new Date(question.created_at); const formattedTime = datetime.toLocaleTimeString("da", { diff --git a/voxpop/static/voxpop.css b/voxpop/static/voxpop.css index 7cfaf14..b68f1e3 100644 --- a/voxpop/static/voxpop.css +++ b/voxpop/static/voxpop.css @@ -116,4 +116,4 @@ div[data-voxpop-uuid] form > .info { background-color: #d4edda; border: 1px solid #c3e6cb; padding: 0.3em 0.5em; -} \ No newline at end of file +} diff --git a/voxpop/views.py b/voxpop/views.py index 6edf8ef..1ad3abc 100644 --- a/voxpop/views.py +++ b/voxpop/views.py @@ -110,7 +110,7 @@ def admin_voxpop(request, voxpop_id: UUID = None): state=Question.State.DISCARDED, ), }, - "idp": voxpop.organisation.idp + "idp": voxpop.organisation.idp, } return render(request, "voxpop/admin/voxpop.html", context) return render(request, "voxpop/admin/auth_error.html") @@ -180,7 +180,7 @@ def index(request): if voxpop: context = { "voxpop": voxpop, - "idp": voxpop.organisation.idp + "idp": voxpop.organisation.idp, } return render(request, "voxpop/index.html", context)