mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2025-01-09 00:35:51 +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>
|
||||
</td>
|
||||
<td>
|
||||
{% if link.added_by %}
|
||||
<a href="{% url 'user-feed' link.added_by.id %}">{{ link.added_by.display_name }}</a>
|
||||
{% else %}
|
||||
<em>{% trans "Unknown user" %}</em>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>
|
||||
{{ link.filelink.filetype }}
|
||||
|
@ -50,7 +54,7 @@
|
|||
<td>
|
||||
{{ link.domain.name }}
|
||||
<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>
|
||||
</td>
|
||||
<td>
|
||||
|
|
|
@ -15,7 +15,11 @@
|
|||
<a href="{{ link.url }}" target="_blank" rel="noopener noreferrer">{{ link.url }}</a>
|
||||
</td>
|
||||
<td>
|
||||
{% if link.added_by %}
|
||||
<a href="{% url 'settings-user' link.added_by.id %}">@{{ link.added_by|username }}</a>
|
||||
{% else %}
|
||||
<em>{% trans "Unknown user" %}</em>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>
|
||||
{% if link.filelink.filetype %}
|
||||
|
|
Loading…
Reference in a new issue