mirror of
https://github.com/ansible/awx.git
synced 2026-05-08 01:47:35 -02:30
remove artifacts from list endpoint (#16230)
This commit is contained in:
@@ -963,13 +963,13 @@ class UnifiedJobSerializer(BaseSerializer):
|
|||||||
|
|
||||||
class UnifiedJobListSerializer(UnifiedJobSerializer):
|
class UnifiedJobListSerializer(UnifiedJobSerializer):
|
||||||
class Meta:
|
class Meta:
|
||||||
fields = ('*', '-job_args', '-job_cwd', '-job_env', '-result_traceback', '-event_processing_finished')
|
fields = ('*', '-job_args', '-job_cwd', '-job_env', '-result_traceback', '-event_processing_finished', '-artifacts')
|
||||||
|
|
||||||
def get_field_names(self, declared_fields, info):
|
def get_field_names(self, declared_fields, info):
|
||||||
field_names = super(UnifiedJobListSerializer, self).get_field_names(declared_fields, info)
|
field_names = super(UnifiedJobListSerializer, self).get_field_names(declared_fields, info)
|
||||||
# Meta multiple inheritance and -field_name options don't seem to be
|
# Meta multiple inheritance and -field_name options don't seem to be
|
||||||
# taking effect above, so remove the undesired fields here.
|
# taking effect above, so remove the undesired fields here.
|
||||||
return tuple(x for x in field_names if x not in ('job_args', 'job_cwd', 'job_env', 'result_traceback', 'event_processing_finished'))
|
return tuple(x for x in field_names if x not in ('job_args', 'job_cwd', 'job_env', 'result_traceback', 'event_processing_finished', 'artifacts'))
|
||||||
|
|
||||||
def get_types(self):
|
def get_types(self):
|
||||||
if type(self) is UnifiedJobListSerializer:
|
if type(self) is UnifiedJobListSerializer:
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ def test_unified_job_detail_exclusive_fields():
|
|||||||
For each type, assert that the only fields allowed to be exclusive to
|
For each type, assert that the only fields allowed to be exclusive to
|
||||||
detail view are the allowed types
|
detail view are the allowed types
|
||||||
"""
|
"""
|
||||||
allowed_detail_fields = frozenset(('result_traceback', 'job_args', 'job_cwd', 'job_env', 'event_processing_finished'))
|
allowed_detail_fields = frozenset(('result_traceback', 'job_args', 'job_cwd', 'job_env', 'event_processing_finished', 'artifacts'))
|
||||||
for cls in UnifiedJob.__subclasses__():
|
for cls in UnifiedJob.__subclasses__():
|
||||||
list_serializer = getattr(serializers, '{}ListSerializer'.format(cls.__name__))
|
list_serializer = getattr(serializers, '{}ListSerializer'.format(cls.__name__))
|
||||||
detail_serializer = getattr(serializers, '{}Serializer'.format(cls.__name__))
|
detail_serializer = getattr(serializers, '{}Serializer'.format(cls.__name__))
|
||||||
|
|||||||
Reference in New Issue
Block a user