From b57ca2eef7760429a67953f7b929d6998706bb7a Mon Sep 17 00:00:00 2001 From: Ihor Palii Date: Mon, 14 Oct 2024 15:20:41 +0300 Subject: [PATCH] Fixed issues with form submit --- static/js/formax.js | 3 +++ temba/triggers/types.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/static/js/formax.js b/static/js/formax.js index e3df59093de..8af3461eb85 100644 --- a/static/js/formax.js +++ b/static/js/formax.js @@ -119,6 +119,9 @@ section = form.parents(".formax-section"); followRedirects = section.data("action") === 'redirect'; + // disable submit button after the button is clicked and form is about to be sent + form.find("input[type=submit]").prop("disabled", true); + const headers = { "X-FORMAX": true } diff --git a/temba/triggers/types.py b/temba/triggers/types.py index ba735ea1592..a4f0ac133f7 100644 --- a/temba/triggers/types.py +++ b/temba/triggers/types.py @@ -151,7 +151,7 @@ def clean(self): cleaned_data = super().clean() # schedule triggers must use specific groups or contacts - if not cleaned_data["groups"] and not cleaned_data["contacts"]: + if not cleaned_data.get("groups") and not cleaned_data.get("contacts"): raise forms.ValidationError(_("Must provide at least one group or contact to include.")) ScheduleFormMixin.clean(self)