use datetime.now instead of today
This commit is contained in:
parent
f07f6f1b46
commit
064406bf89
@ -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)
|
||||
|
||||
|
Reference in New Issue
Block a user