Commit 1fa0574e authored by Sébastiaan Versteeg's avatar Sébastiaan Versteeg Committed by Thom Wiggers
Browse files

Fix empty company logo check on vacancies page

parent 7321503f
......@@ -2,13 +2,18 @@
<div class="card">
<div class="card-top">
<div class="card-image">
<img alt="{{ title }}" src="{{ image_url }}">
{% if image_url %}
<img alt="{{ title }}" src="{{ image_url }}">
{% endif %}
</div>
</div>
<div class="card-block">
<h4 class="card-title mb-1">{{ title }}</h4>
<h5 class="mt-0">{{ company_name }}</h5>
<p class="card-text">{{ description }}</p>
<a href="{{ url }}" class="btn card-btn btn-primary {{ extra_class }}">{% trans "Learn more" %}</a>
<a href="{{ url }}"
class="btn card-btn btn-primary {{ extra_class }}">
{% trans "Learn more" %}
</a>
</div>
</div>
......@@ -42,10 +42,11 @@ def partner_image_card(image):
@register.inclusion_tag('partners/vacancy_card.html')
def vacancy_card(vacancy):
image_url = ''
if vacancy.get_company_logo:
image_url = None
if vacancy.get_company_logo():
image_url = thumbnail(vacancy.get_company_logo(),
settings.THUMBNAIL_SIZES['medium'], fit=False)
settings.THUMBNAIL_SIZES['medium'],
fit=False)
description = truncatechars(bleach(striptags(vacancy.description)), 150)
extra_class = 'external-vacancy'
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment