diff --git a/bookwyrm/views/register.py b/bookwyrm/views/register.py index 1ecb97b16..1a0615ac0 100644 --- a/bookwyrm/views/register.py +++ b/bookwyrm/views/register.py @@ -42,6 +42,12 @@ class Register(View): email = form.data["email"] password = form.data["password"] + # make sure the email isn't blocked as spam + email_domain = email.split("@")[-1] + if models.EmailBlocklist.objects.filter(domain=email_domain).exists(): + # treat this like a successful registration, but don't do anything + return redirect("confirm-email") + # check localname and email uniqueness if models.User.objects.filter(localname=localname).first(): form.errors["localname"] = ["User with this username already exists"]