mirror of
https://github.com/ansible/awx.git
synced 2026-03-08 21:19:26 -02:30
Fix issue AC-1152... disallow creating a schedule for non-cloud
inventory sources
This commit is contained in:
@@ -1372,6 +1372,12 @@ class ScheduleSerializer(BaseSerializer):
|
||||
res['unified_job_template'] = ujt.get_absolute_url() #obj.unified_job_template.get_absolute_url()
|
||||
return res
|
||||
|
||||
def validate_unified_job_template(self, attrs, source):
|
||||
ujt = attrs[source]
|
||||
if type(ujt) == InventorySource and ujt.source not in ('rax', 'ec2',):
|
||||
raise serializers.ValidationError('Inventory Source must be a cloud resource')
|
||||
return attrs
|
||||
|
||||
# We reject rrules if:
|
||||
# - DTSTART is not include
|
||||
# - INTERVAL is not included
|
||||
|
||||
Reference in New Issue
Block a user