mirror of
https://github.com/ansible/awx.git
synced 2026-03-15 07:57:29 -02:30
AC-1040 Change type to job_type when unified_job_template is included in summary_fields.
This commit is contained in:
@@ -197,12 +197,13 @@ class GenericAPIView(generics.GenericAPIView, APIView):
|
||||
# appropriate metadata about the fields that should be supplied.
|
||||
serializer = self.get_serializer()
|
||||
actions['GET'] = serializer.metadata()
|
||||
# Inject the type field choices into GET options as well as on
|
||||
# the metadata itself.
|
||||
if 'type' in actions['GET']:
|
||||
actions['GET']['type']['type'] = 'multiple choice'
|
||||
actions['GET']['type']['choices'] = serializer.get_type_choices()
|
||||
ret['types'] = serializer.get_types()
|
||||
if hasattr(serializer, 'get_types'):
|
||||
# Inject the type field choices into GET options as well as on
|
||||
# the metadata itself.
|
||||
if 'type' in actions['GET']:
|
||||
actions['GET']['type']['type'] = 'multiple choice'
|
||||
actions['GET']['type']['choices'] = serializer.get_type_choices()
|
||||
ret['types'] = serializer.get_types()
|
||||
if actions:
|
||||
ret['actions'] = actions
|
||||
if getattr(self, 'search_fields', None):
|
||||
|
||||
Reference in New Issue
Block a user