#22018: Checks error on ModelAdmins with multiple fields in one line using lists
-------------------------------+--------------------------------------
     Reporter:  jwa            |                    Owner:  nobody
         Type:  Bug            |                   Status:  new
    Component:  contrib.admin  |                  Version:  master
     Severity:  Normal         |               Resolution:
     Keywords:  checks         |             Triage Stage:  Unreviewed
    Has patch:  0              |      Needs documentation:  0
  Needs tests:  0              |  Patch needs improvement:  0
Easy pickings:  0              |                    UI/UX:  0
-------------------------------+--------------------------------------
Changes (by jwa):

 * needs_better_patch:   => 0
 * needs_tests:   => 0
 * needs_docs:   => 0


Comment:

 Additionally, these check methods contain a bug whereas they are trying to
 prevent duplicate fields on a ModelAdmin form. Using `len(set())` on
 nested tuples will not guarantee that there are, in fact, no duplicates. I
 think this requires fixing as well.

 This ModelAdmin for example will pass the checks even though it contains
 duplicate fields:

 {{{
 class FooAdmin(admin.ModelAdmin):
     fields = ('one', ('one', 'two'))
 }}}

-- 
Ticket URL: <https://code.djangoproject.com/ticket/22018#comment:1>
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 django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/061.17710a5441b476164101e4b97263aa5b%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to