Ensure Profile.extra_data is non-null

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

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