From 4c5d2570abc9bbf0b503174e792bc04e7a96cb81 Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Thu, 26 May 2022 11:53:33 -0700 Subject: [PATCH] Save and display stopped date in readthrough --- bookwyrm/models/readthrough.py | 2 +- bookwyrm/templates/readthrough/readthrough_form.html | 1 + bookwyrm/templates/readthrough/readthrough_list.html | 2 +- bookwyrm/views/reading.py | 7 +++++-- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/bookwyrm/models/readthrough.py b/bookwyrm/models/readthrough.py index 5a13fa47..314b40a5 100644 --- a/bookwyrm/models/readthrough.py +++ b/bookwyrm/models/readthrough.py @@ -35,7 +35,7 @@ class ReadThrough(BookWyrmModel): cache.delete(f"latest_read_through-{self.user.id}-{self.book.id}") self.user.update_active_date() # an active readthrough must have an unset finish date - if self.finish_date: + if self.finish_date or self.stopped_date: self.is_active = False super().save(*args, **kwargs) diff --git a/bookwyrm/templates/readthrough/readthrough_form.html b/bookwyrm/templates/readthrough/readthrough_form.html index 1558dada..45c92043 100644 --- a/bookwyrm/templates/readthrough/readthrough_form.html +++ b/bookwyrm/templates/readthrough/readthrough_form.html @@ -19,6 +19,7 @@ {% include "snippets/progress_field.html" with id=field_id %} {% endif %} +