forceReload prevents ajax submission
...instead of weird hacky workarounds forcing refreshes later.
This commit is contained in:
@@ -102,8 +102,6 @@ class ReadingStatus(View):
|
||||
!= desired_shelf.identifier
|
||||
):
|
||||
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"})
|
||||
|
||||
if is_api_request(request):
|
||||
return HttpResponse()
|
||||
|
@@ -101,6 +101,4 @@ def unshelve(request, referer=None, book_id=False):
|
||||
)
|
||||
shelf_book.raise_not_deletable(request.user)
|
||||
shelf_book.delete()
|
||||
if bool(referer):
|
||||
return HttpResponse(headers={"forceReload": "true"})
|
||||
return redirect(request.headers.get("Referer", "/"))
|
||||
|
@@ -125,10 +125,6 @@ class CreateStatus(View):
|
||||
except Http404:
|
||||
pass
|
||||
|
||||
# force page reload if this was triggered from 'move' button
|
||||
if bool(request.POST.get("shelf")):
|
||||
return HttpResponse(headers={"forceReload": "true"})
|
||||
|
||||
if is_api_request(request):
|
||||
return HttpResponse()
|
||||
return redirect("/")
|
||||
|
Reference in New Issue
Block a user