From 72cc1c666261d1b0bc9ea607ec6383d3793d6dfe Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 8 Jan 2024 20:38:09 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/bornhack/forms.py | 1 + src/utils/allauth_pwreset_nospam.py | 2 ++ src/utils/apps.py | 3 +++ 3 files changed, 6 insertions(+) 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