From be7cd33881f9e3e9af31cc7d62883725a5deb75c Mon Sep 17 00:00:00 2001 From: Martin Quarda Date: Wed, 28 Feb 2024 15:49:51 +0100 Subject: [PATCH] request to fill all variables --- alkatorapi/views.py | 6 ++++++ frontend/src/scripts/index.js | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/alkatorapi/views.py b/alkatorapi/views.py index 616684d..344ab85 100644 --- a/alkatorapi/views.py +++ b/alkatorapi/views.py @@ -12,6 +12,12 @@ def register(request): return HttpResponse('{"reason":"Too late!"}', status=400, content_type='application/json') if not request.POST.get('agreement'): 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']): return HttpResponse('{"reason":"Email je již registrován!"}', status=400, content_type='application/json') try: diff --git a/frontend/src/scripts/index.js b/frontend/src/scripts/index.js index 95970e5..483a204 100644 --- a/frontend/src/scripts/index.js +++ b/frontend/src/scripts/index.js @@ -91,7 +91,7 @@ class Main extends Component {
- +