date of birth correction
This commit is contained in:
parent
32b15caef4
commit
c0031f55c2
@ -15,7 +15,7 @@ def register(request):
|
|||||||
if User.objects.filter(email=request.POST['email']):
|
if User.objects.filter(email=request.POST['email']):
|
||||||
return HttpResponse('{"reason":"Email je již registrován!"}', status=400, content_type='application/json')
|
return HttpResponse('{"reason":"Email je již registrován!"}', status=400, content_type='application/json')
|
||||||
try:
|
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):
|
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')
|
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):
|
elif dat < date(1924, 5, 4):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user