Skip to content

Commit

Permalink
Fixed issues with form submit
Browse files Browse the repository at this point in the history
  • Loading branch information
ihor-palii committed Oct 14, 2024
1 parent 46b548f commit b57ca2e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions static/js/formax.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion temba/triggers/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"):

Check warning on line 154 in temba/triggers/types.py

View check run for this annotation

Codecov / codecov/patch

temba/triggers/types.py#L154

Added line #L154 was not covered by tests
raise forms.ValidationError(_("Must provide at least one group or contact to include."))

ScheduleFormMixin.clean(self)
Expand Down

0 comments on commit b57ca2e

Please sign in to comment.