Adds update views
This commit is contained in:
@ -178,3 +178,19 @@ def resolve_book(request):
|
||||
book = connector.get_or_create_book(remote_id)
|
||||
|
||||
return redirect("book", book.id)
|
||||
|
||||
|
||||
@login_required
|
||||
@require_POST
|
||||
@permission_required("bookwyrm.edit_book", raise_exception=True)
|
||||
# pylint: disable=unused-argument
|
||||
def update_book_from_remote(request, connector_identifier, book_id):
|
||||
"""load the remote data for this book"""
|
||||
connector = connector_manager.load_connector(
|
||||
get_object_or_404(models.Connector, identifier=connector_identifier)
|
||||
)
|
||||
book = get_object_or_404(models.Book.objects.select_subclasses(), id=book_id)
|
||||
|
||||
connector.update_book_from_remote(book)
|
||||
|
||||
return redirect("book", book.id)
|
||||
|
Reference in New Issue
Block a user