Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix new JSONField validation. #580

Merged
merged 4 commits into from
Jun 11, 2024
Merged

Commits on May 28, 2024

  1. 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.
    Arjuna Del Toso committed May 28, 2024
    Configuration menu
    Copy the full SHA
    47430af View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    e875882 View commit details
    Browse the repository at this point in the history

Commits on May 29, 2024

  1. Update social_django/models.py

    Co-authored-by: Michal Čihař <[email protected]>
    arjunadeltoso and nijel authored May 29, 2024
    Configuration menu
    Copy the full SHA
    7d9b098 View commit details
    Browse the repository at this point in the history
  2. migration

    Arjuna Del Toso committed May 29, 2024
    Configuration menu
    Copy the full SHA
    4b1a3c8 View commit details
    Browse the repository at this point in the history