[Django] #29332: AdminReadOnly field accepts the optional argument model_admin but treats it as non-optional

5 views
Skip to first unread message

Django

unread,
Apr 16, 2018, 3:42:03 PM4/16/18
to django-...@googlegroups.com
#29332: AdminReadOnly field accepts the optional argument model_admin but treats it
as non-optional
-----------------------------------------+------------------------
Reporter: Josh DM | Owner: nobody
Type: Bug | Status: new
Component: contrib.admin | Version: 1.11
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 1
UI/UX: 0 |
-----------------------------------------+------------------------
Using a FieldSet without providing a `model_admin` results in an error
since AdminReadOnly calls: `model_admin.get_empty_value_display()`.

My expected behaviour is that it does not error, and sets the
`empty_value_display` to the empty string.
Relevant file:
https://github.com/django/django/blob/master/django/contrib/admin/helpers.py

Cheers.

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

Django

unread,
Apr 17, 2018, 9:06:44 AM4/17/18
to django-...@googlegroups.com
#29332: AdminReadonlyField accepts the optional argument model_admin but treats it
as non-optional
-------------------------------+--------------------------------------

Reporter: Josh DM | Owner: nobody
Type: Bug | Status: closed
Component: contrib.admin | Version: 1.11
Severity: Normal | Resolution: duplicate

Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------+--------------------------------------
Changes (by Tim Graham):

* status: new => closed
* resolution: => duplicate


Comment:

Duplicate of #27157.

--
Ticket URL: <https://code.djangoproject.com/ticket/29332#comment:1>

Django

unread,
Apr 17, 2018, 9:07:10 AM4/17/18
to django-...@googlegroups.com
#29332: AdminReadonlyField accepts the optional argument model_admin but treats it
as non-optional
-------------------------------+--------------------------------------

Reporter: Josh DM | Owner: nobody
Type: Bug | Status: closed
Component: contrib.admin | Version: 1.11
Severity: Normal | Resolution: duplicate

Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------+--------------------------------------
Description changed by Tim Graham:

Old description:

> Using a FieldSet without providing a `model_admin` results in an error
> since AdminReadOnly calls: `model_admin.get_empty_value_display()`.
>
> My expected behaviour is that it does not error, and sets the
> `empty_value_display` to the empty string.
> Relevant file:
> https://github.com/django/django/blob/master/django/contrib/admin/helpers.py
>
> Cheers.

New description:

Using a FieldSet without providing a `model_admin` results in an error

since `AdminReadonlyField` calls: `model_admin.get_empty_value_display()`.

My expected behaviour is that it does not error, and sets the
`empty_value_display` to the empty string.
Relevant file:
https://github.com/django/django/blob/master/django/contrib/admin/helpers.py

Cheers.

--

--
Ticket URL: <https://code.djangoproject.com/ticket/29332#comment:2>

Reply all
Reply to author
Forward
0 new messages