Use dummy/nobody image if no photo as been set yet (else, we raise an exception

This commit is contained in:
Oliver Falk
2018-05-09 14:21:33 +02:00
parent 364ea1f1f5
commit 4fb4fc7460

View File

@@ -21,7 +21,11 @@
{% for email in user.confirmedemail_set.all %}
<li><form action="{% url 'remove_confirmed_email' email.id %}" method="post">{% csrf_token %}
<a href="{% url 'assign_photo_email' email.id %}">
{% if email.photo %}
<img class="thumbnail editable avatar-chooser" src="{% url 'raw_image' email.photo.id %}" alt=""></a>
{% else %}
<img class="thumbnail editable avatar-chooser" src="{% static '/img/nobody/64.png' %}" alt="Nobody"></a>
{% endif %}
{{ email.email }}
<br><a href="{% url 'assign_photo_email' email.id %}">{% trans 'Change photo' %}</a>
<br><br><input type="image" src="{% static '/img/delete_button.png' %}" value="{% trans 'Remove' %}"></form></li>