use datetime.now instead of today

This commit is contained in:
Evert Prants 2017-11-11 17:35:21 +02:00
parent f07f6f1b46
commit 064406bf89
Signed by: evert
GPG Key ID: 1688DA83D222D0B5

View File

@ -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)