Ensure Profile.extra_data is non-null

Review Request #7207 — Created April 15, 2015 and submitted

Information

Review Board
release-2.0.x
a8651ec...

Reviewers

Previously, when a user was created through the admin UI, their
extra_data field would be null in the database becuase the field
did not have a value set. This would cause issues when an admin user
created this way would try to access the admin UI, which assumed that
this field was non-null, and an AttributeError exception would be
raised. This patch fixes that issue by ensuring that the user's
extra_data field is non-null at creation time and when accessing
the admin UI.

Ran unit tests.

Verified the following was true:

  • Admins with extra_data=null are able to access the admin panel.
    Their extra_data field is updated to be an empty dict.
  • Users created via the admin panel have their extra_data field as
    an empty dict.

These were not true prior to applying the patch

Description From Last Updated

Should be {} as a default.

chipx86chipx86
reviewbot
  1. Tool: PEP8 Style Checker
    Processed Files:
        reviewboard/admin/views.py
        reviewboard/accounts/models.py
    
    
    
    Tool: Pyflakes
    Processed Files:
        reviewboard/admin/views.py
        reviewboard/accounts/models.py
    
    
  2. 
      
david
  1. Ship It!
  2. 
      
chipx86
  1. 
      
  2. reviewboard/accounts/models.py (Diff revision 1)
     
     
    Show all issues

    Should be {} as a default.

    1. Don't we want to pass in the callable so that we'll get a new dict?

  3. 
      
brennie
Review request changed
Status:
Completed
Change Summary:
Pushed to release-2.0.x (0e73154)