0.0.10
registration form routines
This commit is contained in:
@@ -9,6 +9,7 @@ from django.contrib.auth.decorators import login_required
|
||||
from BaseModels.mailSender import techSendMail
|
||||
from django.utils.translation import gettext as _
|
||||
from datetime import datetime
|
||||
from django.template.loader import render_to_string
|
||||
|
||||
def registration_ajax(request):
|
||||
if request.method != 'POST':
|
||||
@@ -18,6 +19,14 @@ def registration_ajax(request):
|
||||
|
||||
data = request.POST
|
||||
|
||||
from .forms import RegistrationForm
|
||||
form = RegistrationForm(data)
|
||||
if not form.is_valid():
|
||||
Dict = {'form': form}
|
||||
html = render_to_string('forms/f_registration.html', Dict)
|
||||
return JsonResponse({'html': html}, status=400)
|
||||
|
||||
|
||||
res_data = {
|
||||
'errors': 'тестовый верный ответ'
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user