mirror of
https://github.com/ansible/awx.git
synced 2026-05-07 01:17:37 -02:30
do not allow inv src source_project of manual type
This commit is contained in:
@@ -1635,6 +1635,11 @@ class InventorySourceSerializer(UnifiedJobTemplateSerializer, InventorySourceOpt
|
||||
ret['inventory'] = None
|
||||
return ret
|
||||
|
||||
def validate_source_project(self, value):
|
||||
if value.scm_type == '':
|
||||
raise serializers.ValidationError(_("Can not use manual project for SCM-based inventory."))
|
||||
return value
|
||||
|
||||
def validate(self, attrs):
|
||||
def get_field_from_model_or_attrs(fd):
|
||||
return attrs.get(fd, self.instance and getattr(self.instance, fd) or None)
|
||||
|
||||
Reference in New Issue
Block a user