dont allow ppl to enter a bday in the future

master
Aevann 2024-11-10 18:31:24 +02:00
parent 28d0c4ccc0
commit 4320f7b21b
1 changed files with 4 additions and 0 deletions

View File

@ -1145,6 +1145,10 @@ def settings_birthday(v):
birthday = request.values.get('birthday')
try: birthday_utc = timegm(time.strptime(birthday, "%Y-%m-%d"))
except: stop(400, "Invalid birthday!")
if birthday_utc > time.time():
stop(400, "Invalid birthday!")
eighteen_years_ago = time.time() - 31556952 * 18
if birthday_utc > eighteen_years_ago: