fix handling of empty publisher names
parent
044f5a030d
commit
62e00928f4
|
@ -8,7 +8,7 @@ DOAB Linkchecking by Publisher
|
|||
</h2>
|
||||
<ul>
|
||||
{% for publisher in publisher_list %}
|
||||
<li><a href="{% url 'publisher' publisher.publisher_name %}">
|
||||
<li><a href="{% url 'publisher' publisher.publisher_name|default:'*** no publisher name ***' %}">
|
||||
{% if publisher.publisher_name %}{{publisher.publisher_name}}
|
||||
{% else %}*** no publisher name ***
|
||||
{% endif %}
|
||||
|
|
|
@ -48,5 +48,10 @@ class PublisherView(generic.TemplateView):
|
|||
publisher = {'publisher': pub}
|
||||
publisher_items = Item.objects.filter(publisher_name=pub, status=1)
|
||||
publisher['link_count'] = publisher_items.count()
|
||||
if pub == '*** no publisher name ***':
|
||||
pub = ''
|
||||
publisher_items = Item.objects.filter(
|
||||
publisher_name=pub, status=1,
|
||||
)
|
||||
|
||||
return {'publisher': publisher, 'items': publisher_items}
|
||||
|
|
Loading…
Reference in New Issue