Fixes syntax in reading view

This commit is contained in:
Mouse Reeve 2021-09-22 16:41:43 -07:00
parent a96d027cf3
commit d510d72b8d
2 changed files with 5 additions and 4 deletions

View file

@ -113,6 +113,7 @@ class ReadingViews(TestCase):
{ {
"post-status": True, "post-status": True,
"privacy": "followers", "privacy": "followers",
"start_date": readthrough.start_date,
"finish_date": timezone.now().isoformat(), "finish_date": timezone.now().isoformat(),
"id": readthrough.id, "id": readthrough.id,
}, },

View file

@ -193,11 +193,11 @@ def create_readthrough(request):
"""can't use the form because the dates are too finnicky""" """can't use the form because the dates are too finnicky"""
book = get_object_or_404(models.Edition, id=request.POST.get("book")) book = get_object_or_404(models.Edition, id=request.POST.get("book"))
start_date = ( start_date = load_date_in_user_tz_as_utc(
load_date_in_user_tz_as_utc(request.POST.get("start_date"), request.user), request.POST.get("start_date"), request.user
) )
finish_date = ( finish_date = load_date_in_user_tz_as_utc(
load_date_in_user_tz_as_utc(request.POST.get("finish_date"), request.user), request.POST.get("finish_date"), request.user
) )
models.ReadThrough.objects.create( models.ReadThrough.objects.create(
user=request.user, user=request.user,