avoid .filter() to reduce query
@@ -97,7 +97,11 @@ def resource_type(content):
def resource_first_author(content):
if not content:
return ''
- first_creator = content.first_creator
+ first_creator = None
+ for cr in content.metadata.creators.all():
+ if cr.order == 1:
+ first_creator = cr
+ break
if first_creator.name and first_creator.relative_uri:
return format_html('<a href="{desc}">{name}</a>',
desc=first_creator.relative_uri,
