Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: allow JSONField to be blank (#580)
* Fix new JSONField validation. **Description:** Our setup (Django==3.2.25) has an automatic call to full_clean() on all Models in a pre-save signal. After upgrading from 4.0.0 to 5.4.1 all our new Django Admins lost the ability to login. We tracked it down to these calls here https://github.com/python-social-auth/social-app-django/blob/5.4.1/social_django/storage.py#L147, creation fails because `extra_data` is not passed to `create`, but the field is required not null and not blank and not empty dictionary. Making it blank-able and null-able will solve the issue. **TestPlan:** Before the fix (any version between 5.3.0 and 5.4.1): ``` UserSocialAuth.objects.create(user=User.objects.first(), uid=1, provider="test") [...] ValidationError: {'extra_data': ['This field cannot be blank.']} ``` After the fix: the UserSocialAuth instance should be created correctly. Co-authored-by: Arjuna Del Toso <[email protected]> Co-authored-by: Michal Čihař <[email protected]>
- Loading branch information