From 064406bf89e9a00383d0f5db8df2afce8d6b2334 Mon Sep 17 00:00:00 2001 From: Evert Date: Sat, 11 Nov 2017 17:35:21 +0200 Subject: [PATCH] use datetime.now instead of today --- Show/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Show/views.py b/Show/views.py index f3740e9..1bcc5e3 100644 --- a/Show/views.py +++ b/Show/views.py @@ -125,7 +125,7 @@ def SubmissionForm(req, abbreviation, season, episode): return render(req, "submit.html", ctx) # Check if there has been a submission by this user for this episode within the last 24 hours - if Submission.objects.filter(user=user,episode=episode,timestamp__gte=datetime.date.today() - datetime.timedelta(hours=24)).count() > 0: + if Submission.objects.filter(user=user,episode=episode,timestamp__gte=datetime.datetime.now() - datetime.timedelta(hours=24)).count() > 0: ctx['error'] = 'You can only submit one link for an episode in 24 hours!' return render(req, "submit.html", ctx)