Fix breakages with reCAPTCHA-enabled account registration.

Review Request #7967 — Created Feb. 16, 2016 and submitted

Information

Djblets
release-0.10.x

Reviewers

There were two issues causing account registration to fail when using
reCAPTCHA.

The first is that the constructor for the mixin wasn't passing in the
request to the parent constructor, which meant that the registration
form couldn't get to it. This prevented the attribute from being set,
later breaking the form. Turns out we didn't even need this parameter,
so we now just let it stay in kwargs.

The second issue is that there was no validation covering the case where
the user didn't click "I'm not a robot." This led to a KeyError, which
broke the page. That condition is now checked, and a validation error
message returned.

Tested with and without using reCAPTCHA.

I was able to register an account with reCAPTCHA enabled and the
"I'm not a robot" checked.

When leaving it unchecked, I saw an appropriate validation error
message at the top of the form.

reviewbot
  1. Tool: PEP8 Style Checker
    Processed Files:
        djblets/recaptcha/mixins.py
    
    
    
    Tool: Pyflakes
    Processed Files:
        djblets/recaptcha/mixins.py
    
    
  2. 
      
brennie
  1. Ship It!
  2. 
      
chipx86
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to release-0.10.x (58b6319)
Loading...