def clean_email(self):
        if self.cleaned_data['email'].lower() == self.user.email:
            raise forms.ValidationError(_('You\'re already known under this email.'))
        if get_user_model().objects.filter(email__iexact=self.cleaned_data['email']).exclude(email__iexact=self.user.email):
            raise forms.ValidationError(_('This email is already in use. Please supply a different email.'))
        return self.cleaned_data['email']
Check that the backend supports the provided aggregate
dataset/ETHPy150Open bread-and-pepper/django-userena/userena/forms.py/ChangeEmailForm.clean_email--crossover with--dataset/ETHPy150Open cloudera/hue/desktop/core/ext-py/Django-1.6.10/django/db/backends/__init__.py/BaseDatabaseOperations.check_aggregate_support