finally date of birth
This commit is contained in:
parent
c0031f55c2
commit
8b234afe39
@ -5,6 +5,7 @@ class User(models.Model):
|
||||
first_name = models.CharField(max_length=120)
|
||||
last_name = models.CharField(max_length=120)
|
||||
email = models.EmailField(max_length=120)
|
||||
date_of_birth = models.DateField()
|
||||
register_date = models.DateTimeField(auto_now=True)
|
||||
paid = models.BooleanField(default=False)
|
||||
duration = models.DurationField(null=True)
|
||||
|
@ -23,6 +23,11 @@ def register(request):
|
||||
except:
|
||||
return HttpResponse('{"reason":"Špatný formát datu narození!"}', status=400, content_type='application/json')
|
||||
|
||||
user = User(first_name=request.POST['first_name'], last_name=request.POST['last_name'], email=request.POST['email'])
|
||||
user = User(
|
||||
first_name=request.POST['first_name'],
|
||||
last_name=request.POST['last_name'],
|
||||
email=request.POST['email'],
|
||||
date_of_birth=dat,
|
||||
)
|
||||
user.save()
|
||||
return HttpResponse('{"success":"Úspěšná registrace."}', content_type='application/json')
|
||||
|
Loading…
x
Reference in New Issue
Block a user