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

Handle loading invalid JSON from db #248

Merged
merged 2 commits into from
Feb 22, 2020
Merged

Handle loading invalid JSON from db #248

merged 2 commits into from
Feb 22, 2020

Conversation

rpkilby
Copy link
Owner

@rpkilby rpkilby commented Feb 22, 2020

This handles loading invalid JSON values (such as an empty string) from the database. While the field should never save any invalid JSON, it's possible that an invalid value was loaded into the DB through other means. A RuntimeWarning is issued, however the value is still loaded as a string.

Fixes #199 and fixes #100.

@rpkilby rpkilby added this to the 3.0.1 milestone Feb 22, 2020
@codecov
Copy link

codecov bot commented Feb 22, 2020

Codecov Report

Merging #248 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master   #248   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files           4      4           
  Lines         103    109    +6     
  Branches       14     14           
=====================================
+ Hits          103    109    +6
Impacted Files Coverage Δ
src/jsonfield/fields.py 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5e0de07...fa538c2. Read the comment docs.

@rpkilby rpkilby changed the title Handle loading invalid JSON values from db Handle loading invalid JSON from db Feb 22, 2020
@rpkilby rpkilby merged commit c2f8780 into master Feb 22, 2020
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.

Empty string in database renders admin unusable. empty string or null in db
1 participant