Skip to content

Commit

Permalink
Fix AttributeError: 'author_names' (internetarchive#4432)
Browse files Browse the repository at this point in the history
  • Loading branch information
SaravgiYash authored and Sabreen-Parveen committed Feb 15, 2021
1 parent b0bc602 commit 71a01e8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions openlibrary/templates/type/edition/view.html
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@
authors = cond(work, work and work.get_authors(), edition and edition.get_authors())
if authors:
return ', '.join('<a href="%s"%s>%s</a>' % (a.url(), schema_attribute, truncate(a.name, 40)) if a.name else "<em>Unknown author</em>" for a in authors)
elif edition.author_names:
return ('<span%s>' % (schema_attribute)) + ", ".join(edition.author_names) + "</span>"
elif (edition or work).author_names:
return ('<span%s>' % (schema_attribute)) + ", ".join((edition or work).author_names) + "</span>"
else:
return None

Expand Down

0 comments on commit 71a01e8

Please sign in to comment.