def clean_email(self):
if EMAIL_CONFIRMATION:<EOL><INDENT>from .models import EmailAddress<EOL>condition = EmailAddress.objects.filter(<EOL>email__iexact=self.cleaned_data["<STR_LIT:email>"],<EOL>verified=True<EOL>).count() == <NUM_LIT:0><EOL><DEDENT>else:<EOL><INDENT>condition = User.objects.get(<EOL>email__iexact=self.cleaned_data["<STR_LIT:email>"],<EOL>is_active=True<EOL>).count() == <NUM_LIT:0><EOL><DEDENT>if condition is True:<EOL><INDENT>raise forms.ValidationError(<EOL>_("<STR_LIT>")<EOL>)<EOL><DEDENT>return self.cleaned_data["<STR_LIT:email>"]<EOL>
ensure email is in the database