mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-12-23 16:40:36 +00:00
fix bug, can no longer finish a book in the future
This commit is contained in:
parent
68b9791d8c
commit
9a9a7821b7
1 changed files with 3 additions and 3 deletions
|
@ -59,13 +59,13 @@ class ReadThroughForm(CustomForm):
|
||||||
"stopped_date", _("Reading stopped date cannot be before start date.")
|
"stopped_date", _("Reading stopped date cannot be before start date.")
|
||||||
)
|
)
|
||||||
current_time = datetime.datetime.now()
|
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(
|
self.add_error(
|
||||||
"stopped_date", _("Reading stopped date cannot be in the future.")
|
"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(
|
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:
|
class Meta:
|
||||||
|
|
Loading…
Reference in a new issue