Ensure Profile.extra_data is non-null
Review Request #7207 — Created April 15, 2015 and submitted
Previously, when a user was created through the admin UI, their
extra_datafield would benullin 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 anAttributeErrorexception would be
raised. This patch fixes that issue by ensuring that the user's
extra_datafield is non-nullat creation time and when accessing
the admin UI.
Ran unit tests.
Verified the following was true:
- Admins with
extra_data=nullare able to access the admin panel.
Theirextra_datafield is updated to be an empty dict. - Users created via the admin panel have their
extra_datafield as
an empty dict.
These were not true prior to applying the patch
| Description | From | Last Updated |
|---|---|---|
|
Should be {} as a default. |
|
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