mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2025-01-24 07:58:08 +00:00
Don't assume that link domains have a known user
This is an edge case, and they OUGHT to have a user, but if the user was deleted for a remote link, the field won't be able to resolve and the user will be unset.
This commit is contained in:
parent
f7e02061cb
commit
0be4fec167
2 changed files with 9 additions and 1 deletions
|
@ -42,7 +42,11 @@
|
||||||
<a href="{{ link.url }}" target="_blank" rel="noopener noreferrer">{{ link.url }}</a>
|
<a href="{{ link.url }}" target="_blank" rel="noopener noreferrer">{{ link.url }}</a>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
|
{% if link.added_by %}
|
||||||
<a href="{% url 'user-feed' link.added_by.id %}">{{ link.added_by.display_name }}</a>
|
<a href="{% url 'user-feed' link.added_by.id %}">{{ link.added_by.display_name }}</a>
|
||||||
|
{% else %}
|
||||||
|
<em>{% trans "Unknown user" %}</em>
|
||||||
|
{% endif %}
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
{{ link.filelink.filetype }}
|
{{ link.filelink.filetype }}
|
||||||
|
@ -50,7 +54,7 @@
|
||||||
<td>
|
<td>
|
||||||
{{ link.domain.name }}
|
{{ link.domain.name }}
|
||||||
<p>
|
<p>
|
||||||
<a href="{% url 'report-link' link.added_by.id link.id %}">{% trans "Report spam" %}</a>
|
<a href="{% url 'report-link' 0 link.id %}">{% trans "Report spam" %}</a>
|
||||||
</p>
|
</p>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
|
|
|
@ -15,7 +15,11 @@
|
||||||
<a href="{{ link.url }}" target="_blank" rel="noopener noreferrer">{{ link.url }}</a>
|
<a href="{{ link.url }}" target="_blank" rel="noopener noreferrer">{{ link.url }}</a>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
|
{% if link.added_by %}
|
||||||
<a href="{% url 'settings-user' link.added_by.id %}">@{{ link.added_by|username }}</a>
|
<a href="{% url 'settings-user' link.added_by.id %}">@{{ link.added_by|username }}</a>
|
||||||
|
{% else %}
|
||||||
|
<em>{% trans "Unknown user" %}</em>
|
||||||
|
{% endif %}
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
{% if link.filelink.filetype %}
|
{% if link.filelink.filetype %}
|
||||||
|
|
Loading…
Reference in a new issue