From 0be4fec167642f5cf36e6e6b03138994c6a2c56a Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Tue, 5 Jul 2022 16:51:03 -0700 Subject: [PATCH] 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. --- bookwyrm/templates/book/file_links/edit_links.html | 6 +++++- bookwyrm/templates/settings/link_domains/link_table.html | 4 ++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/bookwyrm/templates/book/file_links/edit_links.html b/bookwyrm/templates/book/file_links/edit_links.html index 44206ef77..77a6ff9ff 100644 --- a/bookwyrm/templates/book/file_links/edit_links.html +++ b/bookwyrm/templates/book/file_links/edit_links.html @@ -42,7 +42,11 @@ {{ link.url }} + {% if link.added_by %} {{ link.added_by.display_name }} + {% else %} + {% trans "Unknown user" %} + {% endif %} {{ link.filelink.filetype }} @@ -50,7 +54,7 @@ {{ link.domain.name }}

- {% trans "Report spam" %} + {% trans "Report spam" %}

diff --git a/bookwyrm/templates/settings/link_domains/link_table.html b/bookwyrm/templates/settings/link_domains/link_table.html index 5518477c8..a8ec18d22 100644 --- a/bookwyrm/templates/settings/link_domains/link_table.html +++ b/bookwyrm/templates/settings/link_domains/link_table.html @@ -15,7 +15,11 @@ {{ link.url }} + {% if link.added_by %} @{{ link.added_by|username }} + {% else %} + {% trans "Unknown user" %} + {% endif %} {% if link.filelink.filetype %}