'Ensures a contact with the same name doesn\'t already exists'

def clean_name(self):

    instance = getattr(self, 'instance', None)
    name = self.cleaned_data['name']
    if (instance and (not instance.id)):
        slug = unicode(name).replace('    ', '-')
        slug = defaultfilters.slugify(unidecode(slug))
        if ContactType.objects.filter(slug=slug).exists():
            raise forms.ValidationError(_('Contact    Type    with    such    name    already    exists.'))
    return name
