From b895fbd8f206fc546368534af3c3ba9c802781d2 Mon Sep 17 00:00:00 2001 From: Laura Pircalaboiu Date: Tue, 11 Oct 2022 14:05:20 +0200 Subject: [PATCH] fix bug, can no longer finish a book in the future --- bookwyrm/forms/forms.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bookwyrm/forms/forms.py b/bookwyrm/forms/forms.py index 01abd2e96..0715be62b 100644 --- a/bookwyrm/forms/forms.py +++ b/bookwyrm/forms/forms.py @@ -59,13 +59,13 @@ class ReadThroughForm(CustomForm): "stopped_date", _("Reading stopped date cannot be before start date.") ) current_time = datetime.datetime.now() - if current_time < stopped_date: + if stopped_date is not None and current_time.timestamp() < stopped_date.timestamp(): self.add_error( "stopped_date", _("Reading stopped date cannot be in the future.") ) - if current_time < finish_date: + if finish_date is not None and current_time.timestamp() < finish_date.timestamp(): self.add_error( - "finished_date", _("Reading finished date cannot be in the future.") + "finish_date", _("Reading finished date cannot be in the future.") ) class Meta: