mirror of
https://github.com/ansible/awx.git
synced 2026-01-15 11:50:42 -03:30
tell user how to use update_on_launch with source_project
This commit is contained in:
parent
1c5b0f023e
commit
828821ada6
@ -1672,7 +1672,9 @@ class InventorySourceSerializer(UnifiedJobTemplateSerializer, InventorySourceOpt
|
||||
if attrs.get('source_path', None) and source!='scm':
|
||||
raise serializers.ValidationError({"detail": _("Cannot set source_path if not SCM type.")})
|
||||
elif update_on_launch and source=='scm' and update_on_project_update:
|
||||
raise serializers.ValidationError({"detail": _("Cannot update SCM-based inventory source on launch.")})
|
||||
raise serializers.ValidationError({"detail": _(
|
||||
"Cannot update SCM-based inventory source on launch if set to update on project update. "
|
||||
"Instead, configure the corresponding source project to update on launch.")})
|
||||
elif not self.instance and attrs.get('inventory', None) and InventorySource.objects.filter(
|
||||
inventory=attrs.get('inventory', None), update_on_project_update=True, source='scm').exists():
|
||||
raise serializers.ValidationError({"detail": _("Inventory controlled by project-following SCM.")})
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user