generalize schedule prompts validation

This makes ScheduleSerializer behave same as WFJT nodes
Prevents providing job_type for workflow jobs, as example
This commit is contained in:
AlanCoding
2017-12-08 14:19:22 -05:00
parent 905ff7dad7
commit a9aae91634
4 changed files with 24 additions and 17 deletions

View File

@@ -431,7 +431,8 @@ class UnifiedJobTemplate(PolymorphicModel, CommonModelNameNotUnique, Notificatio
'''
errors = {}
if kwargs:
errors['all'] = [_("Fields {} are not allowed on launch.").format(kwargs.keys())]
for field_name in kwargs.keys():
errors[field_name] = [_("Field is not allowed on launch.")]
return ({}, kwargs, errors)
def accept_or_ignore_variables(self, data, errors=None):