1
0
mirror of https://github.com/ansible/awx.git synced 2024-10-31 23:51:09 +03:00

Remove extra project-related DB hit, follow same pattern as unified jobs

This commit is contained in:
AlanCoding 2016-08-22 14:27:39 -04:00
parent f66fa6fb7c
commit cf81199bbf

View File

@ -285,7 +285,8 @@ class BaseSerializer(serializers.ModelSerializer):
# because it results in additional queries.
if fk == 'job' and isinstance(obj, UnifiedJob):
continue
if fk == 'project' and isinstance(obj, InventorySource):
if fk == 'project' and (isinstance(obj, InventorySource) or
isinstance(obj, Project)):
continue
fkval = getattr(obj, fk, None)