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

Django 4.2.2 breaks the way JSONField behaves #464

Closed
ShaheedHaque opened this issue Jun 9, 2023 · 1 comment · Fixed by #465
Closed

Django 4.2.2 breaks the way JSONField behaves #464

ShaheedHaque opened this issue Jun 9, 2023 · 1 comment · Fixed by #465
Assignees

Comments

@ShaheedHaque
Copy link

Expected behaviour

When using social-app-django's extra_data, prior to Django 4.2.2, the extra data was saved as a dict.

Actual behaviour

With 4.2.2 it is saved as a string instead.

What are the steps to reproduce this issue?

Perform a normal login using a backend that uses extra data, such as SAML.

Any logs, error output, etc?

With Django 4.2.2, and a stack that look like this:

stack

the code at

def set_extra_data(self, extra_data=None):
ends up behaving as follows:

  1. On entry to the two new lines of code added in Django, value is a dict, but is flattened into a string by the new code.
  2. The call to save() then ends up saving a string instead of the dict.

See also the bug I originally filed against Django for this at https://code.djangoproject.com/ticket/34644.

Any other comments?

The referenced Django bug contains suggestions from the Django team on what changes might be needed in social-app-django.

nijel added a commit to nijel/social-app-django that referenced this issue Jun 10, 2023
It was introduced in Django 3.1 and social_django already requires
Django 3.2.

Fixes python-social-auth#464
Fixes python-social-auth#209
@nijel
Copy link
Member

nijel commented Jun 10, 2023

#465 should address this, feedback and testing is welcome.

nijel added a commit to nijel/social-app-django that referenced this issue Jun 10, 2023
It was introduced in Django 3.1 and social_django already requires
Django 3.2.

Fixes python-social-auth#464
Fixes python-social-auth#209
nijel added a commit to nijel/social-app-django that referenced this issue Jun 10, 2023
It was introduced in Django 3.1 and social_django already requires
Django 3.2.

Fixes python-social-auth#464
Fixes python-social-auth#209
@nijel nijel self-assigned this Jun 10, 2023
nijel added a commit that referenced this issue Jun 27, 2023
It was introduced in Django 3.1 and social_django already requires
Django 3.2.

Fixes #464
Fixes #209
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

2 participants