def post(self, request):
     form = CustomUserCreationForm(data=request.POST)
     if form.is_valid():
         form.save()
         return redirect('login')
     messages.error(request, form.error_messages)
     return redirect('login')
Exemple #2
0
 def post(self, request):
     user = CustomUserCreationForm(data=request.POST)
     if user.is_valid():
         user.save()
         return redirect('login')
     else:
         messages.error(request, user.error_messages)
         return redirect('register')