#28577: Create system check for ArrayField(default=[]) (ArrayField with non-
callable mutable default)
------------------------------------------------+------------------------
               Reporter:  Flávio Juvenal        |          Owner:  nobody
                   Type:  New feature           |         Status:  new
              Component:  Core (System checks)  |        Version:  1.11
               Severity:  Normal                |       Keywords:  check
           Triage Stage:  Unreviewed            |      Has patch:  1
    Needs documentation:  0                     |    Needs tests:  0
Patch needs improvement:  0                     |  Easy pickings:  0
                  UI/UX:  1                     |
------------------------------------------------+------------------------
 Django docs state "Incorrectly using default=[] creates a mutable default
 that is shared between all instances of ArrayField." [1].
 This is a subtle bug that can be prevented with a new system check. IMO
 error prevention is good UX. Django should have system checks for those
 warnings in docs.
 I've implemented this check: https://github.com/django/django/pull/8930

 [1]
 
https://docs.djangoproject.com/en/1.11/ref/contrib/postgres/fields/#django.contrib.postgres.fields.ArrayField

-- 
Ticket URL: <https://code.djangoproject.com/ticket/28577>
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/047.c19042a6c0c8cdb459ebc6212aa3060f%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to