code cleanup

This commit is contained in:
Hugh Rundle
2021-11-20 19:19:51 +11:00
parent b406a03533
commit a3270551f9
4 changed files with 6 additions and 2 deletions

View File

@ -94,8 +94,8 @@ def shelve(request):
@require_POST
def unshelve(request, referer=None, book_id=False):
"""remove a book from a user's shelf"""
id = book_id if book_id else request.POST.get("book")
book = get_object_or_404(models.Edition, id=id)
identity = book_id if book_id else request.POST.get("book")
book = get_object_or_404(models.Edition, id=identity)
shelf_book = get_object_or_404(
models.ShelfBook, book=book, shelf__id=request.POST["shelf"]
)