Ejemplo n.º 1
0
 def validate_company_slug(self, company_slug):
     if utilities.is_slug(company_slug):
         return company_slug
     raise serializers.ValidationError([{'company_slug': 'Not valid slug'}])
Ejemplo n.º 2
0
 def validate_company_slug(self, company_slug):
     if utilities.is_slug(company_slug):
         return utilities.check_slug_available(Company, 'company_slug',
                                               company_slug)
     raise serializers.ValidationError([{'company_slug': 'Not valid slug'}])