Merge pull request #1838 from bookwyrm-social/create-readthrough-bug

Fixes bug in verifying readthrough dates
This commit is contained in:
Mouse Reeve 2022-01-18 06:57:34 -08:00 committed by GitHub
commit d20db99501
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -500,7 +500,7 @@ class ReadThroughForm(CustomForm):
cleaned_data = super().clean()
start_date = cleaned_data.get("start_date")
finish_date = cleaned_data.get("finish_date")
if start_date > finish_date:
if start_date and finish_date and start_date > finish_date:
self.add_error(
"finish_date", _("Reading finish date cannot be before start date.")
)