From 8746aa748bd707a4bc4684212cf36de4a608990c Mon Sep 17 00:00:00 2001 From: "Chen, Chien-ting" Date: Thu, 24 Nov 2022 00:27:26 +0800 Subject: [PATCH] correct the error --- khaikang/views.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/khaikang/views.py b/khaikang/views.py index 794be06..1301a80 100644 --- a/khaikang/views.py +++ b/khaikang/views.py @@ -226,7 +226,7 @@ def user_timeline(request, username): latest_received_time = timezone.now() if len(viewed_timeline_list) > 0: - oldest_received_time = viewed_timeline_list[-1].post_time + oldest_received_time = list(viewed_timeline_list)[-1].post_time else: oldest_received_time = datetime.strptime("1970/01/01 00:00", "%Y/%m/%d %H:%M") @@ -251,7 +251,7 @@ def home(request): latest_received_time = timezone.now() if len(public_timeline_list) > 0: - oldest_received_time = public_timeline_list[-1].post_time + oldest_received_time = list(public_timeline_list)[-1].post_time else: oldest_received_time = datetime.strptime("1970/01/01 00:00", "%Y/%m/%d %H:%M")