[Django] #29818: ValueError when parsing querydata to autofill a Django admin form

3 views
Skip to first unread message

Django

unread,
Oct 3, 2018, 6:16:25 AM10/3/18
to django-...@googlegroups.com
#29818: ValueError when parsing querydata to autofill a Django admin form
-----------------------------------------+------------------------------
Reporter: NastuzziSamy | Owner: nobody
Type: Bug | Status: new
Component: contrib.admin | Version: 2.1
Severity: Normal | Keywords: django admin
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 1
UI/UX: 0 |
-----------------------------------------+------------------------------
When giving a pure string instead of an expected integer
(ex:
http://localhost:8002/admin/core/zone/add/?_to_field=id&_popup=1&event=plsbreak
with event = 'plsbreak') , Django admin breaks

"Error during template rendering

In template /usr/local/lib/python3.6/site-
packages/django/contrib/admin/templates/admin/includes/fieldset.html,
error at line 19"

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

Django

unread,
Oct 3, 2018, 9:23:28 AM10/3/18
to django-...@googlegroups.com
#29818: ValueError when parsing querydata to autofill a Django admin form
-------------------------------+--------------------------------------

Reporter: NastuzziSamy | Owner: nobody
Type: Bug | Status: new
Component: contrib.admin | Version: 2.1
Severity: Normal | Resolution:

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

* easy: 1 => 0


Comment:

Can you give more specific steps to reproduce? At first glance, it seems
like the problem is putting a string in a foreign key field but I tried
with the URL `/admin/polls/choice/add/?question=xxx` (from the tutorial)
and don't see a crash.

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

Django

unread,
Oct 3, 2018, 9:42:43 AM10/3/18
to django-...@googlegroups.com
#29818: ValueError when parsing querydata to autofill a Django admin form
-------------------------------+--------------------------------------

Reporter: NastuzziSamy | Owner: nobody
Type: Bug | Status: new
Component: contrib.admin | Version: 2.1
Severity: Normal | Resolution:

Keywords: django admin | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------

Comment (by Herbert Fortes):

I also tried to reproduce.

[03/Oct/2018 13:36:58] "POST
/admin/core/course/add/?_to_field=id&_popup=1&event=plsbreak HTTP/1.1" 200
10098

I do not sure if it is a valid try but no crash here.

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

Django

unread,
Oct 3, 2018, 9:44:25 AM10/3/18
to django-...@googlegroups.com
#29818: ValueError when parsing querydata to autofill a Django admin form
-------------------------------+--------------------------------------

Reporter: NastuzziSamy | Owner: nobody
Type: Bug | Status: new
Component: contrib.admin | Version: 2.1
Severity: Normal | Resolution:

Keywords: django admin | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------
Changes (by Herbert Fortes):

* cc: Herbert Fortes (added)


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

Django

unread,
Oct 3, 2018, 5:18:50 PM10/3/18
to django-...@googlegroups.com
#29818: ValueError when parsing querydata to autofill a Django admin form
-------------------------------+--------------------------------------

Reporter: NastuzziSamy | Owner: nobody
Type: Bug | Status: new
Component: contrib.admin | Version: 2.1
Severity: Normal | Resolution:

Keywords: django admin | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------

Comment (by Herbert Fortes):

Replying to [comment:2 Herbert Fortes]:


> I also tried to reproduce.
>
> [03/Oct/2018 13:36:58] "POST
/admin/core/course/add/?_to_field=id&_popup=1&event=plsbreak HTTP/1.1" 200
10098
>

I am sorry for the "POST". Copy and Paste the wrong line.
But I can not reproduce the ticket.

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

Django

unread,
Oct 4, 2018, 4:18:08 AM10/4/18
to django-...@googlegroups.com
#29818: ValueError when parsing querydata to autofill a Django admin form
-------------------------------+--------------------------------------
Reporter: NastuzziSamy | Owner: nobody
Type: Bug | Status: closed
Component: contrib.admin | Version: 2.1
Severity: Normal | Resolution: needsinfo

Keywords: django admin | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------
Changes (by Carlton Gibson):

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


Comment:

> When giving a pure string instead of an expected integer ...

I couldn't reproduce this.

* When using the expected integer the field is pre-populated with the
correct value.
* When using a string (which is clearly invalid) the form renders
normally, without a pre-populated value.

I don't see a crash.

Thus there must be something else going on in your situation. If you are
able to pin it down to a concrete reproduce case we can investigate.

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

Reply all
Reply to author
Forward
0 new messages