0.0.11
profile page
This commit is contained in:
@@ -26,16 +26,23 @@ def registration_ajax(request):
|
||||
html = render_to_string('forms/f_registration.html', Dict)
|
||||
return JsonResponse({'html': html}, status=400)
|
||||
|
||||
user = User.objects.create_user(username=form.data['email'], email=form.data['email'], password=form.data['password'])
|
||||
# user = auth.authenticate(username=new_user_Dict['name'], password=new_user_Dict['pass'])
|
||||
if user:
|
||||
auth.login(request, user)
|
||||
|
||||
res_data = {
|
||||
'errors': 'тестовый верный ответ'
|
||||
}
|
||||
res_Dict = {}
|
||||
|
||||
JsonResponse(res_Dict)
|
||||
|
||||
except Exception as e:
|
||||
|
||||
res_data = {
|
||||
'errors': f'ошибка в запросе = {str(e)}'
|
||||
errors_Dict = {
|
||||
'errors': {
|
||||
'__all__': f'ошибка в запросе = {str(e)}'
|
||||
}
|
||||
}
|
||||
Dict = {'form': errors_Dict}
|
||||
html = render_to_string('forms/f_registration.html', Dict)
|
||||
return JsonResponse({'html': html}, status=400)
|
||||
|
||||
|
||||
return JsonResponse(res_data)
|
||||
Reference in New Issue
Block a user