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 5, 2021
1 parent 01be70c commit 37c3250
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 @@ -85,8 +85,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 37c3250

Please sign in to comment.