Don't show the series as a link if the book has no author

The series link needs an author so if it doesn't have one, instead of
showing a server error let's just show the series details as plain text
without a link.

Fixes: #2797
This commit is contained in:
Neil Roberts 2023-04-08 17:02:04 +02:00
parent 7272ca2564
commit 41633090ba

View file

@ -46,7 +46,13 @@
<meta itemprop="isPartOf" content="{{ book.series | escape }}">
<meta itemprop="volumeNumber" content="{{ book.series_number }}">
(<a href="{% url 'book-series-by' book.authors.first.id %}?series_name={{ book.series }}">{{ book.series }}{% if book.series_number %} #{{ book.series_number }}{% endif %}</a>)
{% if book.authors.exists %}
<a href="{% url 'book-series-by' book.authors.first.id %}?series_name={{ book.series }}">
{% endif %}
{{ book.series }}{% if book.series_number %} #{{ book.series_number }}{% endif %}
{% if book.authors.exists %}
</a>
{% endif %}
{% endif %}
</p>
{% endif %}