def clean_email(self):
        data = self.cleaned_data['email'].strip().lower()
        validate_email(data)
        duplicate = CouchUser.get_by_username(data)
        if duplicate:
            # sync django user
            duplicate.save()
        if User.objects.filter(username__iexact=data).count() > 0 or duplicate:
            raise forms.ValidationError('Username already taken; please try another')
        return data
dataset/ETHPy150Open dimagi/commcare-hq/corehq/apps/registration/forms.py/NewWebUserRegistrationForm.clean_email/original