From 6ef0dbf91b8e7718024d5e72c4f96a3b046358ca Mon Sep 17 00:00:00 2001 From: Tommi S Date: Fri, 29 Sep 2023 20:10:39 +0300 Subject: [PATCH 1/6] Update kaehmy dates --- templates/kaehmy/kaehmy.html | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/templates/kaehmy/kaehmy.html b/templates/kaehmy/kaehmy.html index f18f596..1afc813 100644 --- a/templates/kaehmy/kaehmy.html +++ b/templates/kaehmy/kaehmy.html @@ -28,12 +28,12 @@

{% trans "Päivämääriä & deadlineja" %}
{% csrf_token %} {% bootstrap_field form.name %} From e00323bffe59f1b1f68710170d1584b35f3577a9 Mon Sep 17 00:00:00 2001 From: Tommi S Date: Fri, 29 Sep 2023 21:27:38 +0300 Subject: [PATCH 2/6] Update readme docker database name --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c6561e9..fee1584 100644 --- a/README.md +++ b/README.md @@ -54,7 +54,7 @@ To run a local development database **[docker](https://docs.docker.com/engine/in After installing docker use the following to create a database: ```bash -docker run --name postgres:12 -e POSTGRES_PASSWORD=postgres -p 5432:5432 -d postgres:12 +docker run --name sik.web.db -e POSTGRES_PASSWORD=postgres -p 5432:5432 -d postgres:12 ``` ## Development From 6004156b6f3176e64ceba2e5f0ac2053386591df Mon Sep 17 00:00:00 2001 From: Tommi S Date: Sun, 1 Oct 2023 17:34:01 +0300 Subject: [PATCH 3/6] Add kaehmybot disable button --- kaehmy/views.py | 6 +++++- templates/kaehmy/kaehmy.html | 5 +++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/kaehmy/views.py b/kaehmy/views.py index 99430db..e0a05f3 100644 --- a/kaehmy/views.py +++ b/kaehmy/views.py @@ -123,6 +123,7 @@ def submit(request, *args, **kwargs): application = form.save() custom_name = form.cleaned_data.get("custom_role_name") custom_is_board = form.cleaned_data.get("custom_role_is_board") + kaehmybot_allowed = form.cleaned_data.get("kaehmybot") if len(custom_name) > 0: custom_role = CustomRole(name=custom_name, is_board=custom_is_board) @@ -141,7 +142,10 @@ def submit(request, *args, **kwargs): send_email(to=to_email, subject=subject, body=message, html=True) logging.debug(f"Sent kaehmy email to recipient <{to_email}>") - processHooks(message=f"Uusi New kaehmy! {name} -> {url}", eventType="kaehmy") + if kaehmybot_allowed or custom_is_board: + processHooks( + message=f"Uusi New kaehmy! {name} -> {url}", eventType="kaehmy" + ) else: context = {"error": form.errors} return render(request, "kaehmy/error.html", context) diff --git a/templates/kaehmy/kaehmy.html b/templates/kaehmy/kaehmy.html index 1afc813..1d74ad2 100644 --- a/templates/kaehmy/kaehmy.html +++ b/templates/kaehmy/kaehmy.html @@ -80,6 +80,11 @@ Hyväksyn tietosuojaselosteen ja tietojeni tallentamisen. {% endblocktrans %} + + {% blocktrans %} + Kähmybot saa lähettää hakemuksestani viestin killan telegramiin (hallitusvirkoihin hakiessa valitse kyllä). + {% endblocktrans %} + {% buttons %}