mirror of
https://github.com/ansible/awx.git
synced 2026-01-20 06:01:25 -03:30
Fix up issue associating type of unified job template summary fields
This commit is contained in:
parent
8c020ddd0b
commit
43ae60d2f4
@ -272,7 +272,11 @@ class BaseSerializer(serializers.ModelSerializer):
|
||||
for field in related_fields:
|
||||
fval = getattr(fkval, field, None)
|
||||
if fval is None and field == 'type':
|
||||
summary_fields[fk][field] = get_type_for_model(fkval)
|
||||
if type(fkval) == UnifiedJobTemplate:
|
||||
obj_actual = UnifiedJobTemplate.objects.get(id=fkval.id)
|
||||
summary_fields[fk][field] = get_type_for_model(obj_actual._get_unified_job_class())
|
||||
else:
|
||||
summary_fields[fk][field] = get_type_for_model(fkval)
|
||||
if fval is not None:
|
||||
summary_fields[fk][field] = fval
|
||||
# Can be raised by the reverse accessor for a OneToOneField.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user