mirror of
https://github.com/ansible/awx.git
synced 2026-03-19 18:07:33 -02:30
Merge pull request #2730 from AlanCoding/slice_license
License check for slicing >1 Reviewed-by: https://github.com/softwarefactory-project-zuul[bot]
This commit is contained in:
@@ -61,7 +61,7 @@ from awx.main.redact import UriCleaner, REPLACE_STR
|
|||||||
|
|
||||||
from awx.main.validators import vars_validate_or_raise
|
from awx.main.validators import vars_validate_or_raise
|
||||||
|
|
||||||
from awx.conf.license import feature_enabled
|
from awx.conf.license import feature_enabled, LicenseForbids
|
||||||
from awx.api.versioning import reverse, get_request_version
|
from awx.api.versioning import reverse, get_request_version
|
||||||
from awx.api.fields import (BooleanNullField, CharNullField, ChoiceNullField,
|
from awx.api.fields import (BooleanNullField, CharNullField, ChoiceNullField,
|
||||||
VerbatimField, DeprecatedCredentialField)
|
VerbatimField, DeprecatedCredentialField)
|
||||||
@@ -3055,6 +3055,13 @@ class JobTemplateSerializer(JobTemplateMixin, UnifiedJobTemplateSerializer, JobO
|
|||||||
def validate_extra_vars(self, value):
|
def validate_extra_vars(self, value):
|
||||||
return vars_validate_or_raise(value)
|
return vars_validate_or_raise(value)
|
||||||
|
|
||||||
|
def validate_job_slice_count(self, value):
|
||||||
|
if value > 1 and not feature_enabled('workflows'):
|
||||||
|
raise LicenseForbids({'job_slice_count': [_(
|
||||||
|
"Job slicing is a workflows-based feature and your license does not allow use of workflows."
|
||||||
|
)]})
|
||||||
|
return value
|
||||||
|
|
||||||
def get_summary_fields(self, obj):
|
def get_summary_fields(self, obj):
|
||||||
summary_fields = super(JobTemplateSerializer, self).get_summary_fields(obj)
|
summary_fields = super(JobTemplateSerializer, self).get_summary_fields(obj)
|
||||||
all_creds = []
|
all_creds = []
|
||||||
|
|||||||
Reference in New Issue
Block a user