Commits

Nathaniel Tucker  committed 0a25df7

Add remote_ip to form class construction. (This allows for recaptcha mixin.)

  • Participants
  • Parent commits 58eef83

Comments (0)

Files changed (1)

File registration/views.py

     argument.
     
     """
+    remote_ip = request.META['REMOTE_ADDR']
     backend = get_backend(backend)
     if not backend.registration_allowed(request):
         return redirect(disallowed_url)
         form_class = backend.get_form_class(request)
 
     if request.method == 'POST':
-        form = form_class(data=request.POST, files=request.FILES)
+        form = form_class(remote_ip=remote_ip, data=request.POST, files=request.FILES)
         if form.is_valid():
             new_user = backend.register(request, **form.cleaned_data)
             if success_url is None:
             else:
                 return redirect(success_url)
     else:
-        form = form_class()
+        form = form_class(remote_ip=remote_ip)
     
     if extra_context is None:
         extra_context = {}