Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Recently I had a configuration error where the
SITE_KEY
remained unset and the empty defaults made the widget render without the captcha and subsequently fail every submission. While the form showed a validation error, it's not user friendly, and it took days until someone reported it. Lack of logging made tracking down this issue needlessly long as well. When this widget is required, having an emptySITE_KEY
and/orSITE_SECRET
is simply an error and should be handled as such.While here, simplify the widget and add the
SITE_KEY
as the hidden input field'svalue=
instead of creating a free floating<script>
tag with a single variable. Use a customdata-
field to make selection easy. TBH I think for this widget bothlabel
(never shown) andname
do not make sense:name
should just be hard coded, as there will never be more than one captcha in one page and then we could simply rely onname
(orid
)...Remove the empty defaults, they dont make sense.
This diff is against 0.16.1
PS.
submitFormButton.removeAttr('type');
generates console errorsUncaught Error: type property can't be changed
and probably shouldnt be used.