From d510d72b8dbfcbc127cf8d3af290dd6258ea98c2 Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Wed, 22 Sep 2021 16:41:43 -0700 Subject: [PATCH] Fixes syntax in reading view --- bookwyrm/tests/views/test_reading.py | 1 + bookwyrm/views/reading.py | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/bookwyrm/tests/views/test_reading.py b/bookwyrm/tests/views/test_reading.py index 3f5846d0..52d10aa6 100644 --- a/bookwyrm/tests/views/test_reading.py +++ b/bookwyrm/tests/views/test_reading.py @@ -113,6 +113,7 @@ class ReadingViews(TestCase): { "post-status": True, "privacy": "followers", + "start_date": readthrough.start_date, "finish_date": timezone.now().isoformat(), "id": readthrough.id, }, diff --git a/bookwyrm/views/reading.py b/bookwyrm/views/reading.py index 99e95ddb..09b4b2bf 100644 --- a/bookwyrm/views/reading.py +++ b/bookwyrm/views/reading.py @@ -193,11 +193,11 @@ def create_readthrough(request): """can't use the form because the dates are too finnicky""" book = get_object_or_404(models.Edition, id=request.POST.get("book")) - start_date = ( - load_date_in_user_tz_as_utc(request.POST.get("start_date"), request.user), + start_date = load_date_in_user_tz_as_utc( + request.POST.get("start_date"), request.user ) - finish_date = ( - load_date_in_user_tz_as_utc(request.POST.get("finish_date"), request.user), + finish_date = load_date_in_user_tz_as_utc( + request.POST.get("finish_date"), request.user ) models.ReadThrough.objects.create( user=request.user,