Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Jan 8, 2024
1 parent c0d0b2a commit 72cc1c6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/bornhack/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 <a href='/camps/'>camp list</a>.",
Expand Down
2 changes: 2 additions & 0 deletions src/utils/allauth_pwreset_nospam.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
3 changes: 3 additions & 0 deletions src/utils/apps.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
from django.apps import AppConfig

from utils.allauth_pwreset_nospam import mock_send_unknown_account_email


class UtilsConfig(AppConfig):
name = "utils"

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

0 comments on commit 72cc1c6

Please sign in to comment.