'Validates that an active user exists with the given email address.'

def clean_email(self):

    UserModel = get_user_model()
    email = self.cleaned_data[u'email']
    self.users_cache = UserModel._default_manager.filter(email__iexact=email)
    if (not len(self.users_cache)):
        raise forms.ValidationError(self.error_messages[u'unknown'])
    if (not any((user.is_active for user in self.users_cache))):
        raise forms.ValidationError(self.error_messages[u'unknown'])
    if any(((user.password == UNUSABLE_PASSWORD) for user in self.users_cache)):
        raise forms.ValidationError(self.error_messages[u'unusable'])
    return email
