#29963: JsonField validates number as a valid json format
-------------------------------------+-------------------------------------
               Reporter:  Khashayar  |          Owner:  nobody
                   Type:  Bug        |         Status:  new
              Component:  Database   |        Version:  1.11
  layer (models, ORM)                |
               Severity:  Normal     |       Keywords:
           Triage Stage:             |      Has patch:  0
  Unreviewed                         |
    Needs documentation:  0          |    Needs tests:  0
Patch needs improvement:  0          |  Easy pickings:  0
                  UI/UX:  0          |
-------------------------------------+-------------------------------------
 Hello,

 There is an issue in JsonField validator.

 It can validate a number instead of key/value format.

 I read its source code and I understand it's for json.dumps() because it
 encodes python data structure to JSON format so it converts a number to
 string and it does not throw an exception as TypeError so JsonField
 validator accepts a number as a correct format and insert it in the
 database.


 {{{
 json.dumps(30)
 }}}
 output is : '30'

-- 
Ticket URL: <https://code.djangoproject.com/ticket/29963>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/059.d19fff746f587244ef38dd1504a98bfe%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to