[Django] #25841: Rendering errors in django admin site causes a HTTP 500

7 views
Skip to first unread message

Django

unread,
Dec 1, 2015, 3:21:02 PM12/1/15
to django-...@googlegroups.com
#25841: Rendering errors in django admin site causes a HTTP 500
----------------------------------+-----------------
Reporter: benzid-wael | Owner:
Type: Bug | Status: new
Component: contrib.postgres | Version: 1.8
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
----------------------------------+-----------------
In the admin site when I entered a bad data for a postgres ArrayField, I
got Http 500, my field is defined as bellow:

{{{#!python
platforms = ArrayField(
models.CharField(max_length=10, choices=PLATFORMS_CHOICES),
verbose_name=_("Supported platforms")
)
}}}

You can see the traceback [https://gist.github.com/1a96a6e4f42aec599201
here]

I also created validator for the platforms field, but it seems that the
error happens before calling my validator

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

Django

unread,
Dec 1, 2015, 4:36:44 PM12/1/15
to django-...@googlegroups.com
#25841: Rendering errors in django admin site causes a HTTP 500
----------------------------------+-------------------------------------
Reporter: benzid-wael | Owner: charettes
Type: Bug | Status: assigned
Component: contrib.postgres | Version: 1.8
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
----------------------------------+-------------------------------------
Changes (by charettes):

* status: new => assigned
* needs_better_patch: => 0
* needs_tests: => 0
* owner: => charettes
* needs_docs: => 0
* stage: Unreviewed => Accepted


Comment:

Confirmed with the latest Django 1.8 and master.

It looks like while `django.contrib.postgres.forms.array.SimpleArrayField`
[https://github.com/django/django/blob/273ce8aa6ae8a7404f5a9cd08f5e2753f1aa9368/django/contrib/postgres/forms/array.py#L49
concatenates it's underlying field's error message it doesn't pass the
original exception's parameters].

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

Django

unread,
Dec 1, 2015, 6:28:06 PM12/1/15
to django-...@googlegroups.com
#25841: Rendering errors in django admin site causes a HTTP 500
----------------------------------+-------------------------------------
Reporter: benzid-wael | Owner: charettes
Type: Bug | Status: assigned
Component: contrib.postgres | Version: 1.8

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
----------------------------------+-------------------------------------
Changes (by charettes):

* needs_better_patch: 0 => 1
* has_patch: 0 => 1
* needs_tests: 0 => 1


Comment:

Here's a [https://github.com/django/django/pull/5753 proposed patch] which
is missing tests.

Could you confirm it fixes your issue?

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

Django

unread,
Dec 13, 2015, 7:34:50 PM12/13/15
to django-...@googlegroups.com
#25841: Rendering errors in django admin site causes a HTTP 500
----------------------------------+-------------------------------------
Reporter: benzid-wael | Owner: charettes
Type: Bug | Status: assigned
Component: contrib.postgres | Version: 1.8

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
----------------------------------+-------------------------------------
Changes (by charettes):

* needs_better_patch: 1 => 0
* needs_tests: 1 => 0


Comment:

I'm pretty confident the patch does solve the reported issue.

--
Ticket URL: <https://code.djangoproject.com/ticket/25841#comment:3>

Django

unread,
Dec 13, 2015, 7:37:33 PM12/13/15
to django-...@googlegroups.com
#25841: ArrayField validation doesn't deal with its base field validation error
message and params correctly.

----------------------------------+-------------------------------------
Reporter: benzid-wael | Owner: charettes
Type: Bug | Status: assigned
Component: contrib.postgres | Version: 1.8

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
----------------------------------+-------------------------------------

--
Ticket URL: <https://code.djangoproject.com/ticket/25841#comment:4>

Django

unread,
Dec 17, 2015, 7:15:41 PM12/17/15
to django-...@googlegroups.com
#25841: ArrayField validation doesn't deal with its base field validation error
message and params correctly.
-------------------------------------+-------------------------------------

Reporter: benzid-wael | Owner: charettes
Type: Bug | Status: assigned
Component: contrib.postgres | Version: 1.8
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
| checkin

Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by timgraham):

* stage: Accepted => Ready for checkin


--
Ticket URL: <https://code.djangoproject.com/ticket/25841#comment:5>

Django

unread,
Dec 17, 2015, 8:26:46 PM12/17/15
to django-...@googlegroups.com
#25841: ArrayField validation doesn't deal with its base field validation error
message and params correctly.
-------------------------------------+-------------------------------------
Reporter: benzid-wael | Owner: charettes
Type: Bug | Status: closed
Component: contrib.postgres | Version: 1.8
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Simon Charette <charette.s@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"3738e4ac46688a0f13139c0b9058fc81c1aac424" 3738e4a]:
{{{
#!CommitTicketReference repository=""
revision="3738e4ac46688a0f13139c0b9058fc81c1aac424"
Fixed #25841 -- Handled base array fields validation errors with params.

Thanks to Trac alias benzid-wael for the report.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/25841#comment:6>

Reply all
Reply to author
Forward
0 new messages