1
0
Fork 0

Adds stopped date separate from finish date on readthrough

This commit is contained in:
Mouse Reeve 2022-05-26 11:33:31 -07:00
parent 1f6fbd8d29
commit 375c5a8789
5 changed files with 29 additions and 3 deletions

View file

@ -53,7 +53,12 @@ class ReadThroughForm(CustomForm):
self.add_error(
"finish_date", _("Reading finish date cannot be before start date.")
)
stopped_date = cleaned_data.get("stopped_date")
if start_date and stopped_date and start_date > stopped_date:
self.add_error(
"stopped_date", _("Reading stopped date cannot be before start date.")
)
class Meta:
model = models.ReadThrough
fields = ["user", "book", "start_date", "finish_date"]
fields = ["user", "book", "start_date", "finish_date", "stopped_date"]