'Clean name'

def clean_name(self):

    data = self.cleaned_data['name']
    existing = User.objects.filter(name=data).exclude(pk=self.instance.id)
    if existing:
        raise forms.ValidationError((_('User    with    username    %s    already    exists.') % data))
    return data
