[Django] #30386: Admin foreign key widgets don't quote keys

20 views
Skip to first unread message

Django

unread,
Apr 19, 2019, 10:47:16 AM4/19/19
to django-...@googlegroups.com
#30386: Admin foreign key widgets don't quote keys
-----------------------------------------+------------------------
Reporter: jclgoodwin | Owner: nobody
Type: Bug | Status: new
Component: contrib.admin | Version: 2.2
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-----------------------------------------+------------------------
In django.contrib.admin.ModelAdmin, _changeform_view, _delete_view and
history_view and do unquote(object_id):

https://github.com/django/django/blob/917fd9d03fdd21538864af4b412ac30b36d99268/django/contrib/admin/options.py#L1537

However, ForeignKeyRawIdWidget and RelatedFieldWidgetWrapper create links
to this view without calling quote():

https://github.com/django/django/blob/89a2216486fa8a0513cbb1d49d2d587d4116c60b/django/contrib/admin/widgets.py#L191

Steps to reproduce:

1. Create two models: Topping with a CharField primary key, and Pizza with
a ForeignKey to Topping. Register both models with the admin site.
2. Create a Topping with the primary key '_40', and a Pizza with that
topping
3. In the admin site, go the the /change/ page for the Pizza, and click on
the 'change' icon for the Topping foreign key, or (if using
ForeignKeyRawIdWidget) the link to the Topping '_40'.
4. See message 'Topping with ID "@" doesn't exist. Perhaps it was
deleted?'.

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

Django

unread,
Apr 23, 2019, 4:31:18 AM4/23/19
to django-...@googlegroups.com
#30386: Admin foreign key widgets don't quote keys.
--------------------------------+------------------------------------
Reporter: Joshua Goodwin | Owner: nobody
Type: Bug | Status: new
Component: contrib.admin | Version: master
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 felixxm):

* version: 2.2 => master
* stage: Unreviewed => Accepted


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

Django

unread,
Apr 23, 2019, 6:55:48 AM4/23/19
to django-...@googlegroups.com
#30386: Admin foreign key widgets don't quote keys.
--------------------------------+------------------------------------
Reporter: Joshua Goodwin | Owner: zeynel
Type: Bug | Status: assigned

Component: contrib.admin | Version: master
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 zeynel):

* owner: nobody => zeynel
* status: new => assigned


Comment:

I believe there are two main parts to handle to fix this bug.

- Quoting `obj.pk` value on
https://github.com/django/django/blob/89a2216486fa8a0513cbb1d49d2d587d4116c60b/django/contrib/admin/widgets.py#L191
- Quoting object pk(or sending quoted values in context) on client side
when user changes the selection on RelatedFieldWidget
https://github.com/django/django/blob/89a2216486fa8a0513cbb1d49d2d587d4116c60b/django/contrib/admin/static/admin/js/admin/RelatedObjectLookups.js#L69

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

Django

unread,
Apr 25, 2019, 5:18:02 PM4/25/19
to django-...@googlegroups.com
#30386: Admin foreign key widgets don't quote keys.
--------------------------------+------------------------------------
Reporter: Joshua Goodwin | Owner: zeynel
Type: Bug | Status: assigned
Component: contrib.admin | Version: master
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 zeynel):

* has_patch: 0 => 1


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

Django

unread,
Sep 5, 2019, 3:35:42 AM9/5/19
to django-...@googlegroups.com
#30386: Admin foreign key widgets don't quote keys.
-------------------------------------+-------------------------------------

Reporter: Joshua Goodwin | Owner: zeynel
Type: Bug | Status: assigned
Component: contrib.admin | Version: master
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 Carlton Gibson):

* stage: Accepted => Ready for checkin


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

Django

unread,
Sep 5, 2019, 3:48:29 AM9/5/19
to django-...@googlegroups.com
#30386: Admin foreign key widgets don't quote keys.
--------------------------------+------------------------------------

Reporter: Joshua Goodwin | Owner: zeynel
Type: Bug | Status: assigned
Component: contrib.admin | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

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

* needs_better_patch: 0 => 1
* stage: Ready for checkin => Accepted


Comment:

I still have some issue when saving models, please check attached project
and try to add a new pizza with e.g. `_40` topping on
`admin/test_one/pizza/add/`.

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

Django

unread,
Sep 5, 2019, 3:49:03 AM9/5/19
to django-...@googlegroups.com
#30386: Admin foreign key widgets don't quote keys.
--------------------------------+------------------------------------
Reporter: Joshua Goodwin | Owner: zeynel
Type: Bug | Status: assigned
Component: contrib.admin | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

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

* Attachment "ticket_30386.zip" added.

Django

unread,
Oct 7, 2021, 8:51:50 AM10/7/21
to django-...@googlegroups.com
#30386: Admin foreign key widgets don't quote keys.
--------------------------------+------------------------------------
Reporter: Joshua Goodwin | Owner: zeynel
Type: Bug | Status: assigned
Component: contrib.admin | Version: dev

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

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

Comment (by Alexander Pervakov):

I'm dive deeper into this and found that `quote(obj.id)` maybe not the
best option and should be debated but the presence of a warning message
when `not isinstance(obj.pk, int)` would be great and will lead people to
this thread. Because stackoverflow is full of questions about quoting the
link in admin but no one provide refs to this ticket that I found after
couple hours of code investigating and testing.

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

Django

unread,
Oct 19, 2021, 6:10:18 AM10/19/21
to django-...@googlegroups.com
#30386: Admin foreign key widgets don't quote keys.
--------------------------------+------------------------------------
Reporter: Joshua Goodwin | Owner: (none)
Type: Bug | Status: new

Component: contrib.admin | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

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

* owner: zeynel => (none)
* status: assigned => new


--
Ticket URL: <https://code.djangoproject.com/ticket/30386#comment:7>

Django

unread,
Feb 9, 2023, 4:23:42 PM2/9/23
to django-...@googlegroups.com
#30386: Admin foreign key widgets don't quote keys.
-------------------------------------+-------------------------------------
Reporter: Joshua Goodwin | Owner:
| Oluwayemisi Ismail
Type: Bug | Status: assigned

Component: contrib.admin | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

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

* owner: (none) => Oluwayemisi Ismail


* status: new => assigned


--
Ticket URL: <https://code.djangoproject.com/ticket/30386#comment:8>

Django

unread,
Feb 17, 2023, 8:15:01 AM2/17/23
to django-...@googlegroups.com
#30386: Admin foreign key widgets don't quote keys.
-------------------------------------+-------------------------------------
Reporter: Joshua Goodwin | Owner:
| Oluwayemisi Ismail
Type: Bug | Status: assigned
Component: contrib.admin | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

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

Comment (by Yhemisi):

Replying to [comment:5 Mariusz Felisiak]:


> I still have some issue when saving models, please check attached
project and try to add a new pizza with e.g. `_40` topping on
`admin/test_one/pizza/add/`.


@Mariusz Felisiak I have checked the attached project and also tried to
add a new pizza which I was able to save models. Could you please confirm
if you are unable to save.

--
Ticket URL: <https://code.djangoproject.com/ticket/30386#comment:9>

Django

unread,
Feb 17, 2023, 8:19:03 AM2/17/23
to django-...@googlegroups.com
#30386: Admin foreign key widgets don't quote keys.
-------------------------------------+-------------------------------------
Reporter: Joshua Goodwin | Owner:
| Oluwayemisi Ismail
Type: Bug | Status: assigned
Component: contrib.admin | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

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

Comment (by Yhemisi):

As regards to this ticket, I worked on it following this steps

class House(models.Model):
name = models.CharField(max_length=255, primary_key=True)
def __str__(self):
return self.name

class Room(models.Model):
house = models.ForeignKey(House, on_delete=models.CASCADE)
def __str__(self):
return self.house.name


using the quote function from django.contrib.admin.utils should fix this

def test_foreign_key_raw_id_widget_renders_quoted_pk_in_change_url(self):
house = House.objects.create(name='?a=b')
rel = Room._meta.get_field('house').remote_field
w = widgets.ForeignKeyRawIdWidget(rel, widget_admin_site)

# apply quote function to primary key value
pk_quoted = quote(str(house.pk))

# render the widget
rendered = w.render('test', house.pk, attrs={})

# check that the primary key is properly quoted in the rendered
HTML
self.assertIn(f'href="/admin_widgets/house/{pk_quoted}/change/"',
rendered)

--
Ticket URL: <https://code.djangoproject.com/ticket/30386#comment:10>

Django

unread,
Feb 17, 2023, 9:45:42 AM2/17/23
to django-...@googlegroups.com
#30386: Admin foreign key widgets don't quote keys.
-------------------------------------+-------------------------------------
Reporter: Joshua Goodwin | Owner:
| Oluwayemisi Ismail
Type: Bug | Status: assigned
Component: contrib.admin | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

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

Comment (by Mariusz Felisiak):

Replying to [comment:9 Yhemisi]:


> Replying to [comment:5 Mariusz Felisiak]:
> > I still have some issue when saving models, please check attached
project and try to add a new pizza with e.g. `_40` topping on
`admin/test_one/pizza/add/`.
>
>
> @Mariusz Felisiak I have checked the attached project and also tried to
add a new pizza which I was able to save models. Could you please confirm
if you are unable to save.

The issue is that you will not be able to add a new pizza with the
proposed patch.

--
Ticket URL: <https://code.djangoproject.com/ticket/30386#comment:11>

Django

unread,
Feb 20, 2023, 9:35:30 AM2/20/23
to django-...@googlegroups.com
#30386: Admin foreign key widgets don't quote keys.
-------------------------------------+-------------------------------------
Reporter: Joshua Goodwin | Owner:
| Oluwayemisi Ismail
Type: Bug | Status: assigned
Component: contrib.admin | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

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

Comment (by Yhemisi):

Doe it mean the quote function isn't a better way of solving this?

--
Ticket URL: <https://code.djangoproject.com/ticket/30386#comment:12>

Django

unread,
Feb 23, 2023, 6:50:01 AM2/23/23
to django-...@googlegroups.com
#30386: Admin foreign key widgets don't quote keys.
-------------------------------------+-------------------------------------
Reporter: Joshua Goodwin | Owner:
| Oluwayemisi Ismail
Type: Bug | Status: assigned
Component: contrib.admin | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

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

Comment (by Carlton Gibson):

> The issue is that you will not be able to add a new pizza with the
proposed patch.

OK, I'm struggle to reproduce this now.

Even at 25b5eea8cdc69a353bb2d22ea2012b09df6c62e4 — which was the reproduce
commit above, with the test project, in Firefox, Edge and Safari, I'm able
to create Pizzas with the Topping `_40` without error. I can't work out
why I'm not seeing this. (Like, did browsers change? 🤔) (

The particular tests from the PRs checking the quoting fail — but pausing
at those points — there's no error saving — i.e. the key isn't quoted but
its working (AFAICS 🤔)

@Yhemisi: given that you're working on this, can you adapt the Selenium
test from the original PR to visit the add a Pizza page and create a new
instance with a topping with e.g. `_40` PK? Does that pass on `main` with
no other changes?

--
Ticket URL: <https://code.djangoproject.com/ticket/30386#comment:13>

Django

unread,
Feb 23, 2023, 7:08:42 AM2/23/23
to django-...@googlegroups.com
#30386: Admin foreign key widgets don't quote keys.
-------------------------------------+-------------------------------------
Reporter: Joshua Goodwin | Owner:
| Oluwayemisi Ismail
Type: Bug | Status: assigned
Component: contrib.admin | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

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

Comment (by Carlton Gibson):

This added on top of the model changes from the
[https://github.com/django/django/pull/11280 original PR] already passes:

{{{
# In class RelatedFieldWidgetSeleniumTests...

def test_pizzas_with_topping_can_be_created(self):
from selenium.webdriver.common.by import By

self.admin_login(username="super", password="secret",
login_url="/")
self.selenium.get(
self.live_server_url +
reverse("admin:admin_widgets_pizza_add")
)
self.select_option("#id_topping", self.toppings[0].pk)
name_field = self.selenium.find_element(By.ID, "id_name")
name_field.send_keys("testing pizza")
save_button_css_selector = ".submit-row > input[type=submit]"
self.selenium.find_element(By.CSS_SELECTOR,
save_button_css_selector).click()
self.wait_for_text(
"li.success", "The pizza “testing pizza” was added
successfully."
)
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/30386#comment:14>

Django

unread,
Feb 23, 2023, 7:22:46 AM2/23/23
to django-...@googlegroups.com
#30386: Admin foreign key widgets don't quote keys.
-------------------------------------+-------------------------------------
Reporter: Joshua Goodwin | Owner:
| Oluwayemisi Ismail
Type: Bug | Status: assigned
Component: contrib.admin | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

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

* Attachment "issue_30386_with_patch_and_save.mp4" added.

Django

unread,
Feb 23, 2023, 7:28:00 AM2/23/23
to django-...@googlegroups.com
#30386: Admin foreign key widgets don't quote keys.
-------------------------------------+-------------------------------------
Reporter: Joshua Goodwin | Owner:
| Oluwayemisi Ismail
Type: Bug | Status: assigned
Component: contrib.admin | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

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

Comment (by Mariusz Felisiak):

I can still reproduce the issue with save when PR 11280 is applied, see
[https://code.djangoproject.com/attachment/ticket/30386/issue_30386_with_patch_and_save.mp4
issue_30386_with_patch_and_save.mp4].

--
Ticket URL: <https://code.djangoproject.com/ticket/30386#comment:15>

Django

unread,
Feb 23, 2023, 7:29:42 AM2/23/23
to django-...@googlegroups.com
#30386: Admin foreign key widgets don't quote keys.
-------------------------------------+-------------------------------------
Reporter: Joshua Goodwin | Owner:
| Oluwayemisi Ismail
Type: Bug | Status: assigned
Component: contrib.admin | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

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

* Attachment "issue_30386.mp4" added.

Django

unread,
Feb 23, 2023, 7:30:29 AM2/23/23
to django-...@googlegroups.com
#30386: Admin foreign key widgets don't quote keys.
-------------------------------------+-------------------------------------
Reporter: Joshua Goodwin | Owner:
| Oluwayemisi Ismail
Type: Bug | Status: assigned
Component: contrib.admin | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

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

Comment (by Mariusz Felisiak):

With the new [https://github.com/django/django/pull/16589 PR] I can
reproduce the original issue, see
[https://code.djangoproject.com/attachment/ticket/30386/issue_30386.mp4
issue_30386.mp4]

--
Ticket URL: <https://code.djangoproject.com/ticket/30386#comment:16>

Django

unread,
Feb 23, 2023, 8:41:03 AM2/23/23
to django-...@googlegroups.com
#30386: Admin foreign key widgets don't quote keys.
-------------------------------------+-------------------------------------
Reporter: Joshua Goodwin | Owner:
| Oluwayemisi Ismail
Type: Bug | Status: assigned
Component: contrib.admin | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

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

Comment (by Carlton Gibson):

Yes, good — thanks for the clarification — got it now. 👍 Thanks!

It looks like the quoting needs to occur in `RelatedObjectLookups.js`
`updateRelatedObjectLinks()` as per the second part of comment:2

@Yhemisi: does that give you enough pointers to work on?

--
Ticket URL: <https://code.djangoproject.com/ticket/30386#comment:17>

Django

unread,
Feb 27, 2023, 5:52:58 AM2/27/23
to django-...@googlegroups.com
#30386: Admin foreign key widgets don't quote keys.
-------------------------------------+-------------------------------------
Reporter: Joshua Goodwin | Owner:
| Oluwayemisi Ismail
Type: Bug | Status: assigned
Component: contrib.admin | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

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

Comment (by Yhemisi):

Replying to [comment:17 Carlton Gibson]:


> Yes, good — thanks for the clarification — got it now. 👍 Thanks!
>
> It looks like the quoting needs to occur in `RelatedObjectLookups.js`
`updateRelatedObjectLinks()` as per the second part of comment:2
>
> @Yhemisi: does that give you enough pointers to work on?

Yes It does. Thank you. I will look it up

--
Ticket URL: <https://code.djangoproject.com/ticket/30386#comment:18>

Django

unread,
Mar 1, 2023, 10:36:42 AM3/1/23
to django-...@googlegroups.com
#30386: Admin foreign key widgets don't quote keys.
-------------------------------------+-------------------------------------
Reporter: Joshua Goodwin | Owner:
| Oluwayemisi Ismail
Type: Bug | Status: assigned
Component: contrib.admin | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

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

Comment (by Yhemisi):

Replying to [comment:16 Mariusz Felisiak]:


> With the new [https://github.com/django/django/pull/16589 PR] I can
reproduce the original issue, see
[https://code.djangoproject.com/attachment/ticket/30386/issue_30386.mp4
issue_30386.mp4]


@Mariusz Felisiak please i want to ask these questions below to be sure
that i understand the problem.

1. Are you trying to say that the issue is not "Admin foreign key widgets
don't quote keys" but the issue is that one will not be able to add a new
pizza ?

2. Is that the inability to add a new pizza is caused by the issue of
admin foreign key widgets not quoting keys with special characters
3. Are you trying to say that both issues exist differently and the
solution doesn't affect each other?

--
Ticket URL: <https://code.djangoproject.com/ticket/30386#comment:19>

Django

unread,
Mar 1, 2023, 1:05:28 PM3/1/23
to django-...@googlegroups.com
#30386: Admin foreign key widgets don't quote keys.
-------------------------------------+-------------------------------------
Reporter: Joshua Goodwin | Owner:
| Oluwayemisi Ismail
Type: Bug | Status: assigned
Component: contrib.admin | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

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

Comment (by Mariusz Felisiak):

> 1. Are you trying to say that the issue is not "Admin foreign key
widgets don't quote keys" but the issue is that one will not be able to


add a new pizza ?

No. There is an original issue from the ticket description, that you can
see on the attached record
[https://code.djangoproject.com/attachment/ticket/30386/issue_30386.mp4
issue_30386.mp4]. Your patch doesn't fix it.

> 2. Is that the inability to add a new pizza is caused by the issue of
admin foreign key widgets not quoting keys with special characters

No. It's a side-effect of [https://github.com/django/django/pull/11280
patch] proposed by Zeynel, so Zeynel's patch fixes the original issue (see
issue_30386.mp4) but introduces a regression (see
issue_30386_with_patch_and_save.mp4​). That's why we couldn't accept it.

--
Ticket URL: <https://code.djangoproject.com/ticket/30386#comment:20>

Django

unread,
Mar 1, 2023, 1:57:04 PM3/1/23
to django-...@googlegroups.com
#30386: Admin foreign key widgets don't quote keys.
-------------------------------------+-------------------------------------
Reporter: Joshua Goodwin | Owner:
| Oluwayemisi Ismail
Type: Bug | Status: assigned
Component: contrib.admin | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

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

Comment (by Yhemisi):

Replying to [comment:20 Mariusz Felisiak]:


> > 1. Are you trying to say that the issue is not "Admin foreign key
widgets don't quote keys" but the issue is that one will not be able to
add a new pizza ?
>
> No. There is an original issue from the ticket description, that you can
see on the attached record
[https://code.djangoproject.com/attachment/ticket/30386/issue_30386.mp4
issue_30386.mp4]. Your patch doesn't fix it.
>
> > 2. Is that the inability to add a new pizza is caused by the issue of
admin foreign key widgets not quoting keys with special characters
>
> No. It's a side-effect of [https://github.com/django/django/pull/11280
patch] proposed by Zeynel, so Zeynel's patch fixes the original issue (see
issue_30386.mp4) but introduces a regression (see
issue_30386_with_patch_and_save.mp4​). That's why we couldn't accept it.

I got it now. Thank you.

--
Ticket URL: <https://code.djangoproject.com/ticket/30386#comment:21>

Django

unread,
Apr 11, 2023, 11:02:17 AM4/11/23
to django-...@googlegroups.com
#30386: Admin foreign key widgets don't quote keys.
-------------------------------------+-------------------------------------
Reporter: Joshua Goodwin | Owner:
| Oluwayemisi Ismail
Type: Bug | Status: assigned
Component: contrib.admin | Version: dev
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 Yhemisi):

* needs_better_patch: 1 => 0


--
Ticket URL: <https://code.djangoproject.com/ticket/30386#comment:22>

Django

unread,
Apr 20, 2023, 5:03:54 AM4/20/23
to django-...@googlegroups.com
#30386: Admin foreign key widgets don't quote keys.
-------------------------------------+-------------------------------------
Reporter: Joshua Goodwin | Owner:
| Oluwayemisi Ismail
Type: Bug | Status: assigned
Component: contrib.admin | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

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

* needs_better_patch: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/30386#comment:23>

Django

unread,
May 5, 2023, 10:39:14 AM5/5/23
to django-...@googlegroups.com
#30386: Admin foreign key widgets don't quote keys.
-------------------------------------+-------------------------------------
Reporter: Joshua Goodwin | Owner:
| Oluwayemisi Ismail
Type: Bug | Status: assigned
Component: contrib.admin | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Natalia Bidart):

For those reading from the top that can't find the "original PR", this is
the one: [https://github.com/django/django/pull/11280 PR]

--
Ticket URL: <https://code.djangoproject.com/ticket/30386#comment:24>

Django

unread,
Sep 26, 2023, 2:11:47 PM9/26/23
to django-...@googlegroups.com
#30386: Admin foreign key widgets don't quote keys.
-------------------------------------+-------------------------------------
Reporter: Joshua Goodwin | Owner:
| Oluwayemisi Ismail
Type: Bug | Status: assigned
Component: contrib.admin | Version: dev
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 Sarah Boyce):

* needs_better_patch: 1 => 0


Comment:

(marking for review as we think the bug is fixed 🤞)

--
Ticket URL: <https://code.djangoproject.com/ticket/30386#comment:25>

Django

unread,
Sep 27, 2023, 3:47:34 AM9/27/23
to django-...@googlegroups.com
#30386: Admin foreign key widgets don't quote keys.
-------------------------------------+-------------------------------------
Reporter: Joshua Goodwin | Owner:
| Oluwayemisi Ismail
Type: Bug | Status: assigned
Component: contrib.admin | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

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

* needs_better_patch: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/30386#comment:26>

Reply all
Reply to author
Forward
0 new messages