Merge pull request #803 from cchurch/remove-fields-for-ad-hoc-commands

Remove unified_job_template and description fields for ad hoc commands
This commit is contained in:
Matthew Jones 2016-02-05 09:55:06 -05:00
commit b8dfa3df16

View File

@ -1737,6 +1737,12 @@ class AdHocCommandSerializer(UnifiedJobSerializer):
},
}
def get_field_names(self, declared_fields, info):
field_names = super(AdHocCommandSerializer, self).get_field_names(declared_fields, info)
# Meta inheritance and -field_name options don't seem to be taking
# effect above, so remove the undesired fields here.
return tuple(x for x in field_names if x not in ('unified_job_template', 'description'))
def build_standard_field(self, field_name, model_field):
field_class, field_kwargs = super(AdHocCommandSerializer, self).build_standard_field(field_name, model_field)
# Load module name choices dynamically from DB settings.