openwisp-radius icon indicating copy to clipboard operation
openwisp-radius copied to clipboard

[change:radius] Replace third-party JSONField with Django built-in JSONField

Open Eeshu-Yadav opened this issue 4 months ago • 3 comments

Checklist

  • [x] I have read the OpenWISP Contributing Guidelines.
  • [x] I have manually tested the changes proposed in this pull request.
  • [x] I have written new test cases for new code and/or updated existing tests for changes to existing code.
  • [ ] I have updated the documentation.

Reference to Existing Issue

Closes #600.

Description of Changes

This PR replaces the third-party jsonfield library with Django's built-in JSONField. The third-party JSONField library hasn't received updates in 5 years, while Django's built-in JSONField is now mature and actively maintained.

Changes Made:

  • Replaced from jsonfield import JSONField with from django.db.models import JSONField in models
  • Updated RadiusBatch.user_credentials and OrganizationRadiusSettings.sms_meta_data fields
  • Removed "jsonfield~=3.1.0" dependency from setup.py
  • Added migration 0041_replace_jsonfield_with_django_builtin.py to handle field type transition
  • Updated test migrations to use Django's JSONField

Testing:

  • All existing tests pass with the new implementation
  • Verified RadiusBatch and SMS metadata functionality
  • Migration tested without data loss

Eeshu-Yadav avatar Aug 10 '25 05:08 Eeshu-Yadav

@nemesifier kindly review

Eeshu-Yadav avatar Oct 22 '25 18:10 Eeshu-Yadav

Coverage Status

coverage: 97.268% (-0.001%) from 97.269% when pulling ba82cd9b82d5320229abc568322f3a33963efbb1 on Eeshu-Yadav:issues/600-replace-jsonfield-clean into 38ee4426cee3a23a15c226c72c29bebce032fe9d on openwisp:master.

coveralls avatar Oct 22 '25 18:10 coveralls

@nemesifier kindly review

Eeshu-Yadav avatar Nov 30 '25 13:11 Eeshu-Yadav