Preserve readthrough id in edit
This commit is contained in:
@ -137,6 +137,10 @@ class CreateReadThrough(View):
|
||||
if not form.is_valid():
|
||||
book = get_object_or_404(models.Edition, id=book_id)
|
||||
data = {"form": form, "book": book}
|
||||
if request.POST.get("id"):
|
||||
data["readthrough"] = get_object_or_404(
|
||||
models.ReadThrough, id=request.POST.get("id")
|
||||
)
|
||||
return TemplateResponse(
|
||||
request, "readthrough/readthrough.html", data
|
||||
)
|
||||
@ -144,7 +148,6 @@ class CreateReadThrough(View):
|
||||
return redirect("book", book_id)
|
||||
|
||||
|
||||
|
||||
@transaction.atomic
|
||||
def update_readthrough_on_shelve(
|
||||
user, annotated_book, status, start_date=None, finish_date=None
|
||||
|
Reference in New Issue
Block a user