Skip to content

Commit

Permalink
Went back to ReCaptchaV2Checkbox
Browse files Browse the repository at this point in the history
  • Loading branch information
AndersSeverinsen committed Oct 18, 2024
1 parent 5fcb18f commit b06d1ba
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
5 changes: 3 additions & 2 deletions bartenders/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from django.urls import reverse
from django.utils.safestring import mark_safe
from django_recaptcha.fields import ReCaptchaField
from django_recaptcha.widgets import ReCaptchaV2Invisible
from django_recaptcha.widgets import ReCaptchaV2Checkbox

from bartab.models import BarTabUser
from fredagscafeen.email import send_template_email
Expand All @@ -15,7 +15,7 @@


class BartenderApplicationForm(forms.ModelForm):
captcha = ReCaptchaField(widget=ReCaptchaV2Invisible)
captcha = ReCaptchaField(widget=ReCaptchaV2Checkbox)

class Meta:
model = BartenderApplication
Expand All @@ -27,6 +27,7 @@ def __init__(self, *args, **kwargs):
self.fields["tshirt_size"].widget.attrs.update({"class": "form-control"})
for name in self.fields:
self.fields[name].required = name != "info"
self.fields["captcha"].widget.attrs.update({"class": "g-recaptcha"})

def send_email(self, pk):
d = self.cleaned_data
Expand Down
4 changes: 2 additions & 2 deletions udlejning/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
from django.urls import reverse
from django.utils.safestring import mark_safe
from django_recaptcha.fields import ReCaptchaField
from django_recaptcha.widgets import ReCaptchaV2Invisible
from django_recaptcha.widgets import ReCaptchaV2Checkbox

from fredagscafeen.email import send_template_email

from .models import UdlejningApplication


class UdlejningApplicationForm(forms.ModelForm):
captcha = ReCaptchaField(widget=ReCaptchaV2Invisible)
captcha = ReCaptchaField(widget=ReCaptchaV2Checkbox)

class Meta:
model = UdlejningApplication
Expand Down
2 changes: 1 addition & 1 deletion web/templates/plain_base.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<script>
window.onload = setThemeToggle()
try {
document.getElementById("id_captcha").parentElement.style.display = "none"
document.getElementById("id_captcha").classList = "g-recaptcha"
} catch (error) {}
</script>
</body>
Expand Down

0 comments on commit b06d1ba

Please sign in to comment.