Replace User.get_profile() with dedicated model look-ups.

Review Request #4590 — Created Sept. 18, 2013 and submitted

Information

Review Board
master

Reviewers

Replace User.get_profile() with dedicated model look-ups.

The user profile module is officially deprecated, and User.get_profile() is
going away in Django 1.7. Just because it's deprecated doesn't make our Profile
model obsolete, it just means we need to do the queries manually.

There's nothing in Review Board itself that causes problems here. In fact,
while I was in here I found some cases where we were using User.get_profile()
where we really wanted Profile.objects.get_or_create(), to ensure that the
profile object existed.

  • Ran unit tests
  • Smoke tested the UI
Description From Last Updated

'IntegrityError' imported but unused

reviewbotreviewbot

'from settings_local import *' used; unable to detect undefined names

reviewbotreviewbot

Col: 49 E702 multiple statements on one line (semicolon)

reviewbotreviewbot

This can just be a get_or_create call, I think.

chipx86chipx86

'from settings_local import *' used; unable to detect undefined names

reviewbotreviewbot

'IntegrityError' imported but unused

reviewbotreviewbot

'from settings_local import *' used; unable to detect undefined names

reviewbotreviewbot

'from settings_local import *' used; unable to detect undefined names

reviewbotreviewbot
reviewbot
  1. This is a review from Review Bot.
    Tool: PEP8 Style Checker
    Processed Files:
    reviewboard/reviews/views.py
    reviewboard/accounts/decorators.py
    reviewboard/reviews/tests.py
    reviewboard/settings.py
    reviewboard/webapi/tests/test_watched_review_group.py
    reviewboard/accounts/views.py
    reviewboard/reviews/managers.py
    reviewboard/reviews/templatetags/reviewtags.py
    reviewboard/diffviewer/diffutils.py
    reviewboard/webapi/resources/base_watched_object.py
    reviewboard/accounts/models.py
    reviewboard/accounts/context_processors.py
    reviewboard/reviews/datagrids.py
    reviewboard/accounts/tests.py
    reviewboard/webapi/tests/test_user.py
    reviewboard/webapi/tests/test_watched_review_request.py
    reviewboard/accounts/forms.py
    Ignored Files:
    reviewboard/templates/base.html

  2. reviewboard/webapi/tests/test_user.py (Diff revision 1)
     
     
    Show all issues

    Col: 49
    E702 multiple statements on one line (semicolon)

  3. 
      
reviewbot
  1. This is a review from Review Bot.
    Tool: Pyflakes
    Processed Files:
    reviewboard/reviews/views.py
    reviewboard/accounts/decorators.py
    reviewboard/reviews/tests.py
    reviewboard/settings.py
    reviewboard/webapi/tests/test_watched_review_group.py
    reviewboard/accounts/views.py
    reviewboard/reviews/managers.py
    reviewboard/reviews/templatetags/reviewtags.py
    reviewboard/diffviewer/diffutils.py
    reviewboard/webapi/resources/base_watched_object.py
    reviewboard/accounts/models.py
    reviewboard/accounts/context_processors.py
    reviewboard/reviews/datagrids.py
    reviewboard/accounts/tests.py
    reviewboard/webapi/tests/test_user.py
    reviewboard/webapi/tests/test_watched_review_request.py
    reviewboard/accounts/forms.py
    Ignored Files:
    reviewboard/templates/base.html

  2. reviewboard/accounts/views.py (Diff revision 1)
     
     
    Show all issues

    'IntegrityError' imported but unused

  3. reviewboard/settings.py (Diff revision 1)
     
     
    Show all issues

    'from settings_local import *' used; unable to detect undefined names

  4. 
      
david
reviewbot
  1. This is a review from Review Bot.
    Tool: PEP8 Style Checker
    Processed Files:
    reviewboard/reviews/views.py
    reviewboard/accounts/decorators.py
    reviewboard/reviews/tests.py
    reviewboard/settings.py
    reviewboard/webapi/tests/test_watched_review_group.py
    reviewboard/accounts/views.py
    reviewboard/reviews/managers.py
    reviewboard/reviews/templatetags/reviewtags.py
    reviewboard/diffviewer/diffutils.py
    reviewboard/webapi/resources/base_watched_object.py
    reviewboard/accounts/models.py
    reviewboard/accounts/context_processors.py
    reviewboard/reviews/datagrids.py
    reviewboard/accounts/tests.py
    reviewboard/webapi/tests/test_user.py
    reviewboard/webapi/tests/test_watched_review_request.py
    reviewboard/accounts/forms.py
    Ignored Files:
    reviewboard/templates/base.html

  2. 
      
reviewbot
  1. This is a review from Review Bot.
    Tool: Pyflakes
    Processed Files:
    reviewboard/reviews/views.py
    reviewboard/accounts/decorators.py
    reviewboard/reviews/tests.py
    reviewboard/settings.py
    reviewboard/webapi/tests/test_watched_review_group.py
    reviewboard/accounts/views.py
    reviewboard/reviews/managers.py
    reviewboard/reviews/templatetags/reviewtags.py
    reviewboard/diffviewer/diffutils.py
    reviewboard/webapi/resources/base_watched_object.py
    reviewboard/accounts/models.py
    reviewboard/accounts/context_processors.py
    reviewboard/reviews/datagrids.py
    reviewboard/accounts/tests.py
    reviewboard/webapi/tests/test_user.py
    reviewboard/webapi/tests/test_watched_review_request.py
    reviewboard/accounts/forms.py
    Ignored Files:
    reviewboard/templates/base.html

  2. reviewboard/settings.py (Diff revision 2)
     
     
    Show all issues

    'from settings_local import *' used; unable to detect undefined names

  3. 
      
chipx86
  1. Looks good. Just one thing, and then I'm happy.

  2. reviewboard/accounts/decorators.py (Diff revision 2)
     
     
     
     
     
     
     
     
     
     
     
     
    Show all issues

    This can just be a get_or_create call, I think.

  3. 
      
david
reviewbot
  1. This is a review from Review Bot.
    Tool: PEP8 Style Checker
    Processed Files:
    reviewboard/reviews/views.py
    reviewboard/accounts/decorators.py
    reviewboard/reviews/tests.py
    reviewboard/settings.py
    reviewboard/webapi/tests/test_watched_review_group.py
    reviewboard/accounts/views.py
    reviewboard/reviews/managers.py
    reviewboard/reviews/templatetags/reviewtags.py
    reviewboard/diffviewer/diffutils.py
    reviewboard/webapi/resources/base_watched_object.py
    reviewboard/accounts/models.py
    reviewboard/accounts/context_processors.py
    reviewboard/reviews/datagrids.py
    reviewboard/accounts/tests.py
    reviewboard/webapi/tests/test_user.py
    reviewboard/webapi/tests/test_watched_review_request.py
    reviewboard/accounts/forms.py
    Ignored Files:
    reviewboard/templates/base.html

  2. 
      
reviewbot
  1. This is a review from Review Bot.
    Tool: Pyflakes
    Processed Files:
    reviewboard/reviews/views.py
    reviewboard/accounts/decorators.py
    reviewboard/reviews/tests.py
    reviewboard/settings.py
    reviewboard/webapi/tests/test_watched_review_group.py
    reviewboard/accounts/views.py
    reviewboard/reviews/managers.py
    reviewboard/reviews/templatetags/reviewtags.py
    reviewboard/diffviewer/diffutils.py
    reviewboard/webapi/resources/base_watched_object.py
    reviewboard/accounts/models.py
    reviewboard/accounts/context_processors.py
    reviewboard/reviews/datagrids.py
    reviewboard/accounts/tests.py
    reviewboard/webapi/tests/test_user.py
    reviewboard/webapi/tests/test_watched_review_request.py
    reviewboard/accounts/forms.py
    Ignored Files:
    reviewboard/templates/base.html

  2. reviewboard/accounts/decorators.py (Diff revision 3)
     
     
    Show all issues

    'IntegrityError' imported but unused

  3. reviewboard/settings.py (Diff revision 3)
     
     
    Show all issues

    'from settings_local import *' used; unable to detect undefined names

  4. 
      
david
reviewbot
  1. This is a review from Review Bot.
    Tool: PEP8 Style Checker
    Processed Files:
    reviewboard/reviews/views.py
    reviewboard/accounts/decorators.py
    reviewboard/reviews/tests.py
    reviewboard/settings.py
    reviewboard/webapi/tests/test_watched_review_group.py
    reviewboard/accounts/views.py
    reviewboard/reviews/managers.py
    reviewboard/reviews/templatetags/reviewtags.py
    reviewboard/diffviewer/diffutils.py
    reviewboard/webapi/resources/base_watched_object.py
    reviewboard/accounts/models.py
    reviewboard/accounts/context_processors.py
    reviewboard/reviews/datagrids.py
    reviewboard/accounts/tests.py
    reviewboard/webapi/tests/test_user.py
    reviewboard/webapi/tests/test_watched_review_request.py
    reviewboard/accounts/forms.py
    Ignored Files:
    reviewboard/templates/base.html

  2. 
      
reviewbot
  1. This is a review from Review Bot.
    Tool: Pyflakes
    Processed Files:
    reviewboard/reviews/views.py
    reviewboard/accounts/decorators.py
    reviewboard/reviews/tests.py
    reviewboard/settings.py
    reviewboard/webapi/tests/test_watched_review_group.py
    reviewboard/accounts/views.py
    reviewboard/reviews/managers.py
    reviewboard/reviews/templatetags/reviewtags.py
    reviewboard/diffviewer/diffutils.py
    reviewboard/webapi/resources/base_watched_object.py
    reviewboard/accounts/models.py
    reviewboard/accounts/context_processors.py
    reviewboard/reviews/datagrids.py
    reviewboard/accounts/tests.py
    reviewboard/webapi/tests/test_user.py
    reviewboard/webapi/tests/test_watched_review_request.py
    reviewboard/accounts/forms.py
    Ignored Files:
    reviewboard/templates/base.html

  2. reviewboard/settings.py (Diff revision 4)
     
     
    Show all issues

    'from settings_local import *' used; unable to detect undefined names

  3. 
      
david
Review request changed
Status:
Completed
Change Summary:

Pushed to master (e1b4b68).