mirror of
https://github.com/ansible/awx.git
synced 2026-03-06 11:11:07 -03:30
Add back group summary_field for v1 InvSrc
This commit is contained in:
@@ -1547,6 +1547,17 @@ class InventorySourceSerializer(UnifiedJobTemplateSerializer, InventorySourceOpt
|
|||||||
fields.pop('group', None)
|
fields.pop('group', None)
|
||||||
return fields
|
return fields
|
||||||
|
|
||||||
|
def get_summary_fields(self, obj): # TODO: remove in 3.3
|
||||||
|
summary_fields = super(InventorySourceSerializer, self).get_summary_fields(obj)
|
||||||
|
if self.V1 and obj.deprecated_group_id:
|
||||||
|
g = obj.deprecated_group
|
||||||
|
summary_fields['group'] = {}
|
||||||
|
for field in SUMMARIZABLE_FK_FIELDS['group']:
|
||||||
|
fval = getattr(g, field, None)
|
||||||
|
if fval is not None:
|
||||||
|
summary_fields['group'][field] = fval
|
||||||
|
return summary_fields
|
||||||
|
|
||||||
def get_group(self, obj): # TODO: remove in 3.3
|
def get_group(self, obj): # TODO: remove in 3.3
|
||||||
if obj.deprecated_group:
|
if obj.deprecated_group:
|
||||||
return obj.deprecated_group.id
|
return obj.deprecated_group.id
|
||||||
|
|||||||
Reference in New Issue
Block a user