Skip to content

refactor: jsonfield pkg->Django JSONField #9284

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

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

jennifer-richards
Copy link
Member

@jennifer-richards jennifer-richards commented Aug 1, 2025

This moves all our JSONField model/form fields to Django's internal classes. These have been available since Django 3.3, and the jsonfield package has been deprecated as of version 3.2.0.

Fixes #9266

We can't actually remove the jsonfield dependency because several0001_* migrations refer to it. After we have merged this PR, we will need to plan another migration reset so we can drop those references. We may want to do this along with or shortly after the Django 5.x migration next year.

Before the migrations can succeed, we need to clean up three Submissions that have null characters in them. These are

>>> Submission.objects.filter(authors__icontains="u0000").values_list("pk", flat=True)
<QuerySet [21133, 21175, 21208]>

These seem to be real cancelled submissions, as the bad data was eventually fixed and the draft submitted successfully. Probably a fixup in the admin to remove the null characters is most appropriate. Testing locally, replacing the \u0000 strings with "(null)" in the authors fields for thoes drafts allows migrations to succeed. Note that doing this requires #9285 be merged first.

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

Successfully merging this pull request may close these issues.

migrate away from deprecated jsonfield package
1 participant