blob: 581043cc1b5733cec18aabe228542a5e1794a7cf (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
from django.contrib.auth import get_user_model
from django.forms.utils import ValidationError
def validate_email_nouser(email):
"""
Check if the email address does not belong to an existing user.
"""
# Check whether we should be subscribed to as a user
#User = get_user_model()
#if User.objects.filter(email__exact=email).exists():
# raise ValidationError(_(
# "The e-mail address '%(email)s' belongs to a user with an "
# "account on this site. Please log in as that user "
# "and try again."
# ) % {'email': email})
pass
|