Flake8 and speed
@@ -359,7 +359,7 @@ class BaseResourceIndex(indexes.SearchIndex, indexes.Indexable):
def prepare_replaced(self, obj):
"""Return True if 'isReplacedBy' attribute exists, otherwise return False."""
if hasattr(obj, 'metadata'):
- return obj.metadata.relations.all().filter(type='isReplacedBy').exists()
+ return obj.metadata.relations.filter(type='isReplacedBy').exists()
else:
return False
