diff --git a/bookwyrm/forms/landing.py b/bookwyrm/forms/landing.py index 831d1d539a..4f5b3223f8 100644 --- a/bookwyrm/forms/landing.py +++ b/bookwyrm/forms/landing.py @@ -64,6 +64,10 @@ def clean(self): if email and models.User.objects.filter(email=email).exists(): self.add_error("email", _("A user with this email already exists.")) + email_domain = email.split("@")[-1] + if email and models.EmailBlocklist.objects.filter(domain=email_domain).exists(): + self.add_error("email", _("This email address cannot be registered.")) + class Meta: model = models.InviteRequest fields = ["email", "answer"]