|
|
@ -38,7 +38,7 @@ class BaseAutomationSerializer(PeriodTaskSerializerMixin, BulkOrgResourceModelSe
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
def validate_name(self, name):
|
|
|
|
def validate_name(self, name):
|
|
|
|
if self.instance:
|
|
|
|
if self.instance and self.instance.name == name:
|
|
|
|
return name
|
|
|
|
return name
|
|
|
|
if BaseAutomation.objects.filter(name=name, type=self.model_type).exists():
|
|
|
|
if BaseAutomation.objects.filter(name=name, type=self.model_type).exists():
|
|
|
|
raise serializers.ValidationError(_('Name already exists'))
|
|
|
|
raise serializers.ValidationError(_('Name already exists'))
|
|
|
|