Skip to content

Commit

Permalink
Upgrade recaptcha extended templates
Browse files Browse the repository at this point in the history
  • Loading branch information
faucomte97 committed Nov 6, 2024
1 parent 03b54e2 commit 94f7f3b
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion portal/forms/play.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ class IndependentStudentSignupForm(forms.Form):
widget=forms.PasswordInput(attrs={"autocomplete": "off", "placeholder": "Repeat password"}),
)

# captcha = ReCaptchaField(widget=ReCaptchaV2Invisible)
captcha = ReCaptchaField(widget=ReCaptchaV2Invisible)

def clean_name(self):
name = self.cleaned_data.get("name", None)
Expand Down
2 changes: 1 addition & 1 deletion portal/forms/teach.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ class TeacherSignupForm(InvitedTeacherForm):
),
)

# captcha = ReCaptchaField(widget=ReCaptchaV2Invisible)
captcha = ReCaptchaField(widget=ReCaptchaV2Invisible)


class TeacherEditAccountForm(forms.Form):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{# This is adapted from django-recaptcha 2.0.5 to work on multiple reCAPTCHA's on the same page #}
{# See verifyCaptcha_{{ widget_uuid}} for the edit #}
<!-- This is adapted from django-recaptcha 4.0.0 to work on multiple
reCAPTCHA's on the same page
See verifyCaptcha_{{ widget_uuid}} for the edit #} -->
<script src="https://{{ recaptcha_domain }}/recaptcha/api.js{% if api_params %}?{{ api_params }}{% endif %}"></script>
<script type="text/javascript">

// Submit function to be called, after reCAPTCHA was successful.
var onSubmit_{{ widget_uuid }} = function(token) {
console.log("reCAPTCHA validated for 'data-widget-uuid=\"{{ widget_uuid }}\"'. Submitting form...")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{# copied from django-recaptcha 2.0.5 #}
{% include "captcha/includes/js_v2_invisible.html" %}
<!-- copied from django-recaptcha 4.0.0 -->
{% include "django_recaptcha/includes/js_v2_invisible.html" %}
<div class="g-recaptcha"
{% for name, value in widget.attrs.items %}{% if value is not False %} {{ name }}{% if value is not True %}="{{ value|stringformat:'s' }}"{% endif %}{% endif %}{% endfor %}
>
Expand Down

0 comments on commit 94f7f3b

Please sign in to comment.