block user from shooting themselves in the foot by scheduling a manual project

This commit is contained in:
AlanCoding
2016-10-10 11:40:36 -04:00
parent 48c155dfb0
commit 42cf74b085
4 changed files with 18 additions and 5 deletions

View File

@@ -2826,6 +2826,8 @@ class ScheduleSerializer(BaseSerializer):
def validate_unified_job_template(self, value):
if type(value) == InventorySource and value.source not in SCHEDULEABLE_PROVIDERS:
raise serializers.ValidationError(_('Inventory Source must be a cloud resource.'))
elif type(value) == Project and value.scm_type == '':
raise serializers.ValidationError(_('Manual Project can not have a schedule set.'))
return value
# We reject rrules if: