Add the recaptcha module

Review Request #7937 — Created Feb. 1, 2016 and submitted

Information

Djblets
release-0.10.x
aa8ef6c...

Reviewers

The djblets.recaptcha module provides a form mixin that supports
reCAPTCHA API version 2.

reCAPTCHA is an implementation of CAPTCHA (Completely Automated
Public Turing Test to tell Computers and Humans Apart) by Google.
It is used in web forms to prevent them from being filled out and
submitted by automated bots.

  • Used this with Splat.
  • Ran unit tests.
  • Built and viewed the docs.
Description From Last Updated

Col: 1 W391 blank line at end of file

reviewbotreviewbot

Can you extend this to say how it's used? Might also be nice to include a reference to the guide.

chipx86chipx86

"reCAPTCHA"

chipx86chipx86

Maybe we should say to contact an administrator.

chipx86chipx86

Let's check for a KeyError on access, in case we somehow get something we don't expect.

chipx86chipx86

Can we call this recaptcha_form_field?

chipx86chipx86

In case we decide to backport any of this (wouldn't be bad to have in a 2.5), we should use …

chipx86chipx86

This file is intended only for built-in Django settings. Maybe we want a Djblets equivalent, but I think we should …

chipx86chipx86

Space before <.

chipx86chipx86

It'd be cool to have a little example showing a form's HTML and mixing in. Though it's easy to do, …

chipx86chipx86

Trailing blank line.

chipx86chipx86

'settings' imported but unused

reviewbotreviewbot

'format_html' imported but unused

reviewbotreviewbot

With logging.exception you don't need to format the exception into the log string. This should also be "reCAPTCHA", not "ReCaptcha"

daviddavid

With logging.exception you don't need to format the exception into the log string.

daviddavid

Too many blank lines here.

daviddavid

IIRC the description should go on the next line.

daviddavid
reviewbot
  1. Tool: PEP8 Style Checker
    Processed Files:
        djblets/siteconfig/django_settings.py
        djblets/recaptcha/mixins.py
        djblets/recaptcha/__init__.py
        djblets/recaptcha/apps.py
    
    Ignored Files:
        docs/djblets/coderef/index.rst
    
    
    
    Tool: Pyflakes
    Processed Files:
        djblets/siteconfig/django_settings.py
        djblets/recaptcha/mixins.py
        djblets/recaptcha/__init__.py
        djblets/recaptcha/apps.py
    
    Ignored Files:
        docs/djblets/coderef/index.rst
    
    
  2. djblets/recaptcha/mixins.py (Diff revision 1)
     
     
    Show all issues
    Col: 1
     W391 blank line at end of file
    
  3. 
      
brennie
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        djblets/siteconfig/django_settings.py
        djblets/recaptcha/mixins.py
        djblets/recaptcha/__init__.py
        djblets/recaptcha/apps.py
    
    Ignored Files:
        docs/djblets/coderef/index.rst
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        djblets/siteconfig/django_settings.py
        djblets/recaptcha/mixins.py
        djblets/recaptcha/__init__.py
        djblets/recaptcha/apps.py
    
    Ignored Files:
        docs/djblets/coderef/index.rst
    
    
  2. 
      
brennie
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        djblets/siteconfig/django_settings.py
        djblets/recaptcha/mixins.py
        djblets/recaptcha/__init__.py
        djblets/recaptcha/apps.py
    
    Ignored Files:
        docs/djblets/coderef/index.rst
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        djblets/siteconfig/django_settings.py
        djblets/recaptcha/mixins.py
        djblets/recaptcha/__init__.py
        djblets/recaptcha/apps.py
    
    Ignored Files:
        docs/djblets/coderef/index.rst
    
    
  2. 
      
brennie
reviewbot
  1. Tool: PEP8 Style Checker
    Processed Files:
        djblets/recaptcha/templatetags/djblets_recaptcha.py
        djblets/siteconfig/django_settings.py
        djblets/recaptcha/mixins.py
        djblets/recaptcha/__init__.py
        djblets/recaptcha/apps.py
    
    Ignored Files:
        docs/djblets/guides/recaptcha/index.rst
        docs/djblets/guides/recaptcha/using-recaptcha.rst
        docs/djblets/guides/index.rst
        djblets/recaptcha/templatetags/__init__.py
        docs/djblets/coderef/index.rst
    
    
    
    Tool: Pyflakes
    Processed Files:
        djblets/recaptcha/templatetags/djblets_recaptcha.py
        djblets/siteconfig/django_settings.py
        djblets/recaptcha/mixins.py
        djblets/recaptcha/__init__.py
        djblets/recaptcha/apps.py
    
    Ignored Files:
        docs/djblets/guides/recaptcha/index.rst
        docs/djblets/guides/recaptcha/using-recaptcha.rst
        docs/djblets/guides/index.rst
        djblets/recaptcha/templatetags/__init__.py
        docs/djblets/coderef/index.rst
    
    
  2. 
      
chipx86
  1. Awesome :)

    Some thoughts, mostly doc/error-related.

  2. djblets/recaptcha/mixins.py (Diff revision 4)
     
     
    Show all issues

    Can you extend this to say how it's used? Might also be nice to include a reference to the guide.

  3. djblets/recaptcha/mixins.py (Diff revision 4)
     
     
     
    Show all issues

    "reCAPTCHA"

  4. djblets/recaptcha/mixins.py (Diff revision 4)
     
     
    Show all issues

    Maybe we should say to contact an administrator.

  5. djblets/recaptcha/mixins.py (Diff revision 4)
     
     
     
     
     
    Show all issues

    Let's check for a KeyError on access, in case we somehow get something we don't expect.

  6. Show all issues

    Can we call this recaptcha_form_field?

  7. Show all issues

    In case we decide to backport any of this (wouldn't be bad to have in a 2.5), we should use {0} instead of {}, as the latter breaks on Python 2.6.

  8. djblets/siteconfig/django_settings.py (Diff revision 4)
     
     
    Show all issues

    This file is intended only for built-in Django settings. Maybe we want a Djblets equivalent, but I think we should do what djblets.log does, where there's a siteconfig.py in djblets.recaptcha that provides the settings map and lets the caller use it.

  9. Show all issues

    Space before <.

  10. Show all issues

    It'd be cool to have a little example showing a form's HTML and mixing in. Though it's easy to do, having it as reference will be useful.

    Also, an example with using this in a SiteConfiguration would be good.

  11. Show all issues

    Trailing blank line.

  12. 
      
chipx86
  1. Oh also, can you add more to the description for the commit? There's not much info on what this is for, especially if you don't know reCAPTCHA.

  2. 
      
brennie
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        djblets/recaptcha/siteconfig.py
        djblets/recaptcha/apps.py
        djblets/siteconfig/django_settings.py
        djblets/recaptcha/__init__.py
        djblets/recaptcha/mixins.py
        djblets/recaptcha/templatetags/djblets_recaptcha.py
        djblets/recaptcha/widgets.py
    
    Ignored Files:
        docs/djblets/guides/recaptcha/index.rst
        docs/djblets/guides/recaptcha/using-recaptcha.rst
        docs/djblets/guides/index.rst
        djblets/recaptcha/templatetags/__init__.py
        docs/djblets/coderef/index.rst
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        djblets/recaptcha/siteconfig.py
        djblets/recaptcha/apps.py
        djblets/siteconfig/django_settings.py
        djblets/recaptcha/__init__.py
        djblets/recaptcha/mixins.py
        djblets/recaptcha/templatetags/djblets_recaptcha.py
        djblets/recaptcha/widgets.py
    
    Ignored Files:
        docs/djblets/guides/recaptcha/index.rst
        docs/djblets/guides/recaptcha/using-recaptcha.rst
        docs/djblets/guides/index.rst
        djblets/recaptcha/templatetags/__init__.py
        docs/djblets/coderef/index.rst
    
    
  2. Show all issues
     'settings' imported but unused
    
  3. Show all issues
     'format_html' imported but unused
    
  4. 
      
brennie
brennie
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        djblets/recaptcha/siteconfig.py
        djblets/recaptcha/apps.py
        djblets/siteconfig/django_settings.py
        djblets/recaptcha/__init__.py
        djblets/recaptcha/mixins.py
        djblets/recaptcha/templatetags/djblets_recaptcha.py
        djblets/recaptcha/widgets.py
    
    Ignored Files:
        docs/djblets/guides/recaptcha/index.rst
        docs/djblets/guides/recaptcha/using-recaptcha.rst
        docs/djblets/guides/index.rst
        djblets/recaptcha/templatetags/__init__.py
        docs/djblets/coderef/index.rst
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        djblets/recaptcha/siteconfig.py
        djblets/recaptcha/apps.py
        djblets/siteconfig/django_settings.py
        djblets/recaptcha/__init__.py
        djblets/recaptcha/mixins.py
        djblets/recaptcha/templatetags/djblets_recaptcha.py
        djblets/recaptcha/widgets.py
    
    Ignored Files:
        docs/djblets/guides/recaptcha/index.rst
        docs/djblets/guides/recaptcha/using-recaptcha.rst
        docs/djblets/guides/index.rst
        djblets/recaptcha/templatetags/__init__.py
        docs/djblets/coderef/index.rst
    
    
  2. 
      
brennie
brennie
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        djblets/recaptcha/siteconfig.py
        djblets/recaptcha/apps.py
        djblets/siteconfig/django_settings.py
        djblets/recaptcha/__init__.py
        djblets/recaptcha/mixins.py
        djblets/recaptcha/templatetags/djblets_recaptcha.py
        djblets/recaptcha/widgets.py
    
    Ignored Files:
        docs/djblets/guides/recaptcha/index.rst
        docs/djblets/guides/recaptcha/using-recaptcha.rst
        docs/djblets/guides/index.rst
        djblets/recaptcha/templatetags/__init__.py
        docs/djblets/coderef/index.rst
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        djblets/recaptcha/siteconfig.py
        djblets/recaptcha/apps.py
        djblets/siteconfig/django_settings.py
        djblets/recaptcha/__init__.py
        djblets/recaptcha/mixins.py
        djblets/recaptcha/templatetags/djblets_recaptcha.py
        djblets/recaptcha/widgets.py
    
    Ignored Files:
        docs/djblets/guides/recaptcha/index.rst
        docs/djblets/guides/recaptcha/using-recaptcha.rst
        docs/djblets/guides/index.rst
        djblets/recaptcha/templatetags/__init__.py
        docs/djblets/coderef/index.rst
    
    
  2. 
      
brennie
reviewbot
  1. Tool: Pyflakes
    Processed Files:
        djblets/recaptcha/siteconfig.py
        djblets/recaptcha/apps.py
        djblets/recaptcha/__init__.py
        djblets/recaptcha/mixins.py
        djblets/recaptcha/templatetags/djblets_recaptcha.py
        djblets/recaptcha/widgets.py
    
    Ignored Files:
        docs/djblets/guides/recaptcha/index.rst
        docs/djblets/guides/recaptcha/using-recaptcha.rst
        docs/djblets/guides/index.rst
        djblets/recaptcha/templatetags/__init__.py
        docs/djblets/coderef/index.rst
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        djblets/recaptcha/siteconfig.py
        djblets/recaptcha/apps.py
        djblets/recaptcha/__init__.py
        djblets/recaptcha/mixins.py
        djblets/recaptcha/templatetags/djblets_recaptcha.py
        djblets/recaptcha/widgets.py
    
    Ignored Files:
        docs/djblets/guides/recaptcha/index.rst
        docs/djblets/guides/recaptcha/using-recaptcha.rst
        docs/djblets/guides/index.rst
        djblets/recaptcha/templatetags/__init__.py
        docs/djblets/coderef/index.rst
    
    
  2. 
      
david
  1. 
      
  2. djblets/recaptcha/mixins.py (Diff revision 8)
     
     
    Show all issues

    With logging.exception you don't need to format the exception into the log string. This should also be "reCAPTCHA", not "ReCaptcha"

  3. djblets/recaptcha/mixins.py (Diff revision 8)
     
     
     
    Show all issues

    With logging.exception you don't need to format the exception into the log string.

  4. Show all issues

    Too many blank lines here.

  5. 
      
brennie
reviewbot
  1. Tool: PEP8 Style Checker
    Processed Files:
        djblets/recaptcha/siteconfig.py
        djblets/recaptcha/apps.py
        djblets/recaptcha/__init__.py
        djblets/recaptcha/mixins.py
        djblets/recaptcha/templatetags/djblets_recaptcha.py
        djblets/recaptcha/widgets.py
    
    Ignored Files:
        docs/djblets/guides/recaptcha/index.rst
        docs/djblets/guides/recaptcha/using-recaptcha.rst
        docs/djblets/guides/index.rst
        djblets/recaptcha/templatetags/__init__.py
        docs/djblets/coderef/index.rst
    
    
    
    Tool: Pyflakes
    Processed Files:
        djblets/recaptcha/siteconfig.py
        djblets/recaptcha/apps.py
        djblets/recaptcha/__init__.py
        djblets/recaptcha/mixins.py
        djblets/recaptcha/templatetags/djblets_recaptcha.py
        djblets/recaptcha/widgets.py
    
    Ignored Files:
        docs/djblets/guides/recaptcha/index.rst
        docs/djblets/guides/recaptcha/using-recaptcha.rst
        docs/djblets/guides/index.rst
        djblets/recaptcha/templatetags/__init__.py
        docs/djblets/coderef/index.rst
    
    
  2. 
      
david
  1. 
      
  2. djblets/recaptcha/mixins.py (Diff revision 9)
     
     
    Show all issues

    IIRC the description should go on the next line.

  3. 
      
brennie
Review request changed
Status:
Completed
Change Summary:
Pushed to release-0.10.x (142da51)