diff --git a/bookwyrm/templates/book/book.html b/bookwyrm/templates/book/book.html index 0e2fd5d39..fa098281e 100644 --- a/bookwyrm/templates/book/book.html +++ b/bookwyrm/templates/book/book.html @@ -12,6 +12,15 @@ {% endblock %} {% block content %} +{% if update_error %} +
+ + + {% trans "Unable to connect to remote source." %} + +
+{% endif %} + {% with user_authenticated=request.user.is_authenticated can_edit_book=perms.bookwyrm.edit_book %}
diff --git a/bookwyrm/views/books/books.py b/bookwyrm/views/books/books.py index 3556a0dc1..a010c300f 100644 --- a/bookwyrm/views/books/books.py +++ b/bookwyrm/views/books/books.py @@ -22,7 +22,7 @@ from bookwyrm.views.helpers import is_api_request class Book(View): """a book! this is the stuff""" - def get(self, request, book_id, user_statuses=False): + def get(self, request, book_id, user_statuses=False, update_error=False): """info about a book""" if is_api_request(request): book = get_object_or_404( @@ -80,6 +80,7 @@ class Book(View): else None, "rating": reviews.aggregate(Avg("rating"))["rating__avg"], "lists": lists, + "update_error": update_error, } if request.user.is_authenticated: @@ -195,6 +196,6 @@ def update_book_from_remote(request, book_id, connector_identifier): connector.update_book_from_remote(book) except ConnectorException: # the remote source isn't available or doesn't know this book - pass + return Book().get(request, book_id, update_error=True) return redirect("book", book.id)