def validate_name(self, value):
    potential_slug = slugify(value)
    if Project.objects.filter(slug=potential_slug).exists():
        raise serializers.ValidationError(_('Project with slug "{0}" already exists.').format(potential_slug))
    return value
def validate_name(self, value):
    potential_slug = slugify(value)
    if Project.objects.filter(slug=potential_slug).exists():
        raise serializers.ValidationError(_('Project with slug "{0}" already exists.').format(potential_slug))
    return value