mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-11-25 19:11:09 +00:00
Catch error when trying to update book
This commit is contained in:
parent
b32f3c1b7b
commit
739b394ccc
1 changed files with 6 additions and 2 deletions
|
@ -12,7 +12,7 @@ from django.views.decorators.http import require_POST
|
||||||
|
|
||||||
from bookwyrm import forms, models
|
from bookwyrm import forms, models
|
||||||
from bookwyrm.activitypub import ActivitypubResponse
|
from bookwyrm.activitypub import ActivitypubResponse
|
||||||
from bookwyrm.connectors import connector_manager
|
from bookwyrm.connectors import connector_manager, ConnectorException
|
||||||
from bookwyrm.connectors.abstract_connector import get_image
|
from bookwyrm.connectors.abstract_connector import get_image
|
||||||
from bookwyrm.settings import PAGE_LENGTH
|
from bookwyrm.settings import PAGE_LENGTH
|
||||||
from bookwyrm.views.helpers import is_api_request
|
from bookwyrm.views.helpers import is_api_request
|
||||||
|
@ -191,6 +191,10 @@ def update_book_from_remote(request, book_id, connector_identifier):
|
||||||
)
|
)
|
||||||
book = get_object_or_404(models.Book.objects.select_subclasses(), id=book_id)
|
book = get_object_or_404(models.Book.objects.select_subclasses(), id=book_id)
|
||||||
|
|
||||||
|
try:
|
||||||
connector.update_book_from_remote(book)
|
connector.update_book_from_remote(book)
|
||||||
|
except ConnectorException:
|
||||||
|
# the remote source isn't available or doesn't know this book
|
||||||
|
pass
|
||||||
|
|
||||||
return redirect("book", book.id)
|
return redirect("book", book.id)
|
||||||
|
|
Loading…
Reference in a new issue