def validate_email(self, value):
if EMAIL_CONFIRMATION:<EOL><INDENT>queryset = EmailAddress.objects.filter(email__iexact=value, verified=True)<EOL><DEDENT>else:<EOL><INDENT>queryset = User.objects.get(email__iexact=value, is_active=True).count() == <NUM_LIT:0><EOL><DEDENT>if queryset.count() < <NUM_LIT:1>:<EOL><INDENT>raise serializers.ValidationError(_("<STR_LIT>"))<EOL><DEDENT>return queryset.first().email<EOL>
ensure email is in the database