Code review comment for lp:~sinzui/launchpad/spam-eggs-bug-495250

Revision history for this message
Curtis Hovey (sinzui) wrote :

This is my branch to discourage spammers.

    lp:~sinzui/launchpad/spam-eggs-bug-495250
    Diff size: 282
    Launchpad bug: https://bugs.launchpad.net/bugs/495250
    Test command: ./bin/test -vvt "person-views"
    Pre-implementation: flacoste, gary
    Target release: 3.1.12

= Discourage spammers =

Do not link the homepage_content of probationary users. Do not let search
engine index probationary user' pages.

== Rules ==

    * All users with karma == 0 are probationary.
    * Set the robots directive to noindex,nofollow
    * Do not linkify the homepage_content.
    * Set the HTTP status code to 410 on profile pages for suspended accounts.

== QA ==

    * Locate a suspended user (search answers)
      * Verify the request response headers are set the status code to 410.
    * Locate an account with zero karma.
      * Verify that the profile page meta robots tag is index,nofollow.
    * Locate an account with zero karma and a description (probably a spammer)
      * Verify the homepage text is not formated as HTML.

== Lint ==

Linting changed files:
  lib/lp/registry/browser/person.py
  lib/lp/registry/browser/tests/person-views.txt
  lib/lp/registry/templates/person-index.pt

== Test ==

    * lib/lp/registry/browser/tests/person-views.txt
      * Added tests to verify is_probationary_or_invalid_user and
        homepage_content properties on the PersonView.
      * Add a test to verify that the HTTP status code is set to 410
        for suspended accounts.

== Implementation ==

    * lib/lp/registry/browser/person.py
      * Added is_probationary_or_invalid_user and homepage_content properties
        to control how to display the profile page for probationary users.
      * Redefined the render() method to set the status code to 410 when the
        account is suspended.
    * lib/lp/registry/templates/person-index.pt
      * Updated the template to use the view instead of the context object
        to show content and set the meta data.
    * lib/lp/testing/views.py
      * Discovered that path_info was not used. I updated the helper to
        use it.

« Back to merge proposal