Don't redirect on http request to readthrough

This commit is contained in:
Mouse Reeve 2021-09-29 11:02:04 -07:00
parent d78c278665
commit 52c6a90498
2 changed files with 3 additions and 1 deletions

View file

@ -167,6 +167,8 @@ def edit_readthrough(request):
# use default now for date field
readthrough.create_update()
if is_api_request(request):
return HttpResponse()
return redirect(request.headers.get("Referer", "/"))

View file

@ -138,7 +138,7 @@ class DeleteAndRedraft(View):
@login_required
@require_POST
def update_progress(request, book_id):
def update_progress(request, book_id): # pylint: disable=unused-argument
"""Either it's just a progress update, or it's a comment with a progress update"""
if request.POST.get("post-status"):
return CreateStatus.as_view()(request, "comment")