mirror of
https://github.com/ansible/awx.git
synced 2026-02-19 20:20:06 -03:30
Merge pull request #2669 from paradegoat/issue-2370
Updated JT project-related error message Reviewed-by: https://github.com/softwarefactory-project-zuul[bot]
This commit is contained in:
@@ -3046,7 +3046,7 @@ class JobTemplateSerializer(JobTemplateMixin, UnifiedJobTemplateSerializer, JobO
|
|||||||
|
|
||||||
prompting_error_message = _("Must either set a default value or ask to prompt on launch.")
|
prompting_error_message = _("Must either set a default value or ask to prompt on launch.")
|
||||||
if project is None:
|
if project is None:
|
||||||
raise serializers.ValidationError({'project': _("Job types 'run' and 'check' must have assigned a project.")})
|
raise serializers.ValidationError({'project': _("Job Templates must have a project assigned.")})
|
||||||
elif inventory is None and not get_field_from_model_or_attrs('ask_inventory_on_launch'):
|
elif inventory is None and not get_field_from_model_or_attrs('ask_inventory_on_launch'):
|
||||||
raise serializers.ValidationError({'inventory': prompting_error_message})
|
raise serializers.ValidationError({'inventory': prompting_error_message})
|
||||||
|
|
||||||
|
|||||||
@@ -315,7 +315,7 @@ class JobTemplate(UnifiedJobTemplate, JobOptions, SurveyJobTemplateMixin, Resour
|
|||||||
if self.inventory is None and not self.ask_inventory_on_launch:
|
if self.inventory is None and not self.ask_inventory_on_launch:
|
||||||
validation_errors['inventory'] = [_("Job Template must provide 'inventory' or allow prompting for it."),]
|
validation_errors['inventory'] = [_("Job Template must provide 'inventory' or allow prompting for it."),]
|
||||||
if self.project is None:
|
if self.project is None:
|
||||||
validation_errors['project'] = [_("Job types 'run' and 'check' must have assigned a project."),]
|
validation_errors['project'] = [_("Job Templates must have a project assigned."),]
|
||||||
return validation_errors
|
return validation_errors
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
|||||||
Reference in New Issue
Block a user