diff --git a/src/bornhack/forms.py b/src/bornhack/forms.py index c6af76a32..a9b3f4957 100644 --- a/src/bornhack/forms.py +++ b/src/bornhack/forms.py @@ -4,6 +4,7 @@ class AllAuthSignupCaptchaForm(forms.Form): """Used with settings.ACCOUNT_SIGNUP_FORM_CLASS to add a captcha field.""" + first_bornhack_year = forms.CharField( initial="", help_text="Please help us prevent a few bot signups by telling us the year of the first BornHack. You can find a list of all BornHack events in the camp list.", diff --git a/src/utils/allauth_pwreset_nospam.py b/src/utils/allauth_pwreset_nospam.py index 32a4a1278..9cab9b321 100644 --- a/src/utils/allauth_pwreset_nospam.py +++ b/src/utils/allauth_pwreset_nospam.py @@ -1,4 +1,6 @@ """Noop method to disable email sending.""" + + def mock_send_unknown_account_email(self, request, email): # do not send email to unknown accounts, see # https://github.com/pennersr/django-allauth/issues/3333 diff --git a/src/utils/apps.py b/src/utils/apps.py index ab2da466c..2a2e3be7f 100644 --- a/src/utils/apps.py +++ b/src/utils/apps.py @@ -1,6 +1,8 @@ from django.apps import AppConfig + from utils.allauth_pwreset_nospam import mock_send_unknown_account_email + class UtilsConfig(AppConfig): name = "utils" @@ -8,4 +10,5 @@ def ready(self): """Do stuff after apps are loaded.""" # monkeypatch password reset form from allauth.account.forms import ResetPasswordForm + ResetPasswordForm._send_unknown_account_mail = mock_send_unknown_account_email