request to fill all variables
This commit is contained in:
parent
8b234afe39
commit
be7cd33881
@ -12,6 +12,12 @@ def register(request):
|
|||||||
return HttpResponse('{"reason":"Too late!"}', status=400, content_type='application/json')
|
return HttpResponse('{"reason":"Too late!"}', status=400, content_type='application/json')
|
||||||
if not request.POST.get('agreement'):
|
if not request.POST.get('agreement'):
|
||||||
return HttpResponse('{"reason":"Je potřeba souhlasit se zpracováním údajů!"}', status=400, content_type='application/json')
|
return HttpResponse('{"reason":"Je potřeba souhlasit se zpracováním údajů!"}', status=400, content_type='application/json')
|
||||||
|
if not request.POST['first_name']:
|
||||||
|
return HttpResponse('{"reason":"Jméno je povinné!"}', status=400, content_type='application/json')
|
||||||
|
if not request.POST['last_name']:
|
||||||
|
return HttpResponse('{"reason":"Přijmení je povinné!"}', status=400, content_type='application/json')
|
||||||
|
if not request.POST['email']:
|
||||||
|
return HttpResponse('{"reason":"Email je povinný!"}', status=400, content_type='application/json')
|
||||||
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:
|
||||||
|
@ -91,7 +91,7 @@ class Main extends Component {
|
|||||||
</div>
|
</div>
|
||||||
<div class="mb-3">
|
<div class="mb-3">
|
||||||
<label for="date_of_birth" class="form-label">Datum narození</label>
|
<label for="date_of_birth" class="form-label">Datum narození</label>
|
||||||
<input type="date" class="form-control" id="date_of_birth" name="date_of_birth" />
|
<input type="date" class="form-control" id="date_of_birth" name="date_of_birth" max={new Date().toJSON().slice(0, 10)} />
|
||||||
</div>
|
</div>
|
||||||
<div class="mb-3 form-check">
|
<div class="mb-3 form-check">
|
||||||
<input type="checkbox" class="form-check-input" id="agreement" name="agreement" />
|
<input type="checkbox" class="form-check-input" id="agreement" name="agreement" />
|
||||||
|
Loading…
x
Reference in New Issue
Block a user