def clean_email(self):
        """ ensure email is in the database """
        if EMAIL_CONFIRMATION:
            from .models import EmailAddress
            condition = EmailAddress.objects.filter(
                email__iexact=self.cleaned_data["email"],
                verified=True
            ).count() == 0
        else:
            condition = User.objects.get(
                email__iexact=self.cleaned_data["email"],
                is_active=True
            ).count() == 0

        if condition is True:
            raise forms.ValidationError(
                _("Email address not verified for any user account")
            )
        return self.cleaned_data["email"]
ensure email is in the database