From c0031f55c24ce1393640f37d0f7bd008ae8d6da0 Mon Sep 17 00:00:00 2001 From: Martin Quarda Date: Wed, 28 Feb 2024 11:59:51 +0100 Subject: [PATCH] date of birth correction --- alkatorapi/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/alkatorapi/views.py b/alkatorapi/views.py index b8c2182..75f0d7d 100644 --- a/alkatorapi/views.py +++ b/alkatorapi/views.py @@ -15,7 +15,7 @@ def register(request): if User.objects.filter(email=request.POST['email']): return HttpResponse('{"reason":"Email je již registrován!"}', status=400, content_type='application/json') try: - dat = datetime.strptime(request.POST['date_of_birth'], "%d/%m/%Y").date() + dat = datetime.strptime(request.POST['date_of_birth'], "%Y-%m-%d").date() if dat > date(2006, 5, 4): return HttpResponse('{"reason":"Je potřeba mít 18 let v den závodu!"}', status=400, content_type='application/json') elif dat < date(1924, 5, 4):