Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed issues with duplicates during spamming form submit #413

Merged
merged 1 commit into from
Nov 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@
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
Loading