#20352: ModelAdmin form validation does not check inherited 
get_readonly_fields()
----------------------------+----------------------------------------------
     Reporter:  soulne4ny   |      Owner:  nobody
         Type:  Bug         |     Status:  new
    Component:              |    Version:  1.5
  contrib.admin             |   Keywords:  admin readonly fields validation
     Severity:  Normal      |  Has patch:  0
 Triage Stage:  Unreviewed  |      UI/UX:  0
Easy pickings:  0           |
----------------------------+----------------------------------------------
 While trying to create a custom _base_ class InlineModelAdmin with a set
 of predefined "evaluated"-fields I found that a _child_ inline model admin
 gets an error

     ImproperlyConfigured: 'AnInlineModelAdmin.fields' refers to field
 'base_field' that is missing from the form.

 For more flexibility I didn't use the readonly_fields attribute, but the
 get_readonly_fields() method.

 However, it works when the readonly_fields attribute is set.  After
 looking in the admin validation code, I found that get_readonly_fields()
 works well with redefined get_form(), even if it just returns super().

 It would be nice to have consistent behavoiur %)

-- 
Ticket URL: <https://code.djangoproject.com/ticket/20352>
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].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to