don't try to update non-existent readthroughs

This commit is contained in:
Hugh Rundle 2021-11-20 16:03:46 +11:00
parent af9768a2e3
commit 12810d8e34
No known key found for this signature in database
GPG key ID: CD23D6039184286B
2 changed files with 5 additions and 6 deletions

View file

@ -86,8 +86,6 @@ 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 with comments (doesn't force reload)
# 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)

View file

@ -118,10 +118,11 @@ class CreateStatus(View):
status.save(created=created) status.save(created=created)
# update a readthrough, if needed # update a readthrough, if needed
try: if bool(request.POST.get("id")):
edit_readthrough(request) try:
except Http404: edit_readthrough(request)
pass except Http404:
pass
# force page reload if this was triggered from 'move' button # force page reload if this was triggered from 'move' button
if bool(request.POST.get("shelf")): if bool(request.POST.get("shelf")):