forked from mirrors/bookwyrm
fix shelves not being unshelved if any shelf is read-status
This commit is contained in:
parent
6951b52365
commit
a082121930
1 changed files with 7 additions and 3 deletions
|
@ -86,15 +86,19 @@ class ReadingStatus(View):
|
||||||
if request.POST.get("post-status"):
|
if request.POST.get("post-status"):
|
||||||
# is it a comment?
|
# is it a comment?
|
||||||
if request.POST.get("content"):
|
if request.POST.get("content"):
|
||||||
# BUG: there is a problem posting statuses for finishing
|
# BUG: there is a problem posting statuses with comments (doesn't force reload)
|
||||||
# check whether it existed before.
|
# there is a DIFFERENT problem *updating* read statuses/comments
|
||||||
return CreateStatus.as_view()(request, "comment")
|
return CreateStatus.as_view()(request, "comment")
|
||||||
privacy = request.POST.get("privacy")
|
privacy = request.POST.get("privacy")
|
||||||
handle_reading_status(request.user, desired_shelf, book, privacy)
|
handle_reading_status(request.user, desired_shelf, book, privacy)
|
||||||
|
|
||||||
|
# if the request includes a "shelf" value we are using the 'move' button
|
||||||
if bool(request.POST.get("shelf")):
|
if bool(request.POST.get("shelf")):
|
||||||
if current_status_shelfbook is None:
|
# unshelve the existing shelf
|
||||||
|
this_shelf = request.POST.get("shelf")
|
||||||
|
if int(this_shelf) not in [1,2,3]:
|
||||||
return unshelve(request, referer=referer, book_id=book_id)
|
return unshelve(request, referer=referer, book_id=book_id)
|
||||||
|
# don't try to unshelve a read status shelf: it has already been deleted.
|
||||||
return HttpResponse(headers={"forceReload" : "true"})
|
return HttpResponse(headers={"forceReload" : "true"})
|
||||||
|
|
||||||
if is_api_request(request):
|
if is_api_request(request):
|
||||||
|
|
Loading…
Reference in a new issue