Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#30502 closed Bug (invalid)

Admin interface hangs on models with "parentNode" field .

Reported by: Jari Tenhunen Owned by: nobody
Component: contrib.admin Version: dev
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

if you have a relation named "parentNode", the django admin page gets stuck/unresponsive (eternal loop in js code?) when adding/editing a row with the problematic relation.

Example model that triggers the bug:

class Node(models.Model):

    name = models.CharField(max_length=255)
    # "parentNode" as the foreign key name causes problems with Django admin js code =(
    parentNode = models.ForeignKey('self', blank=True, null=True, on_delete=models.CASCADE)

Change History (1)

comment:1 by Mariusz Felisiak, 5 years ago

Component: Uncategorizedcontrib.admin
Resolution: invalid
Status: newclosed
Summary: Admin interface freezes if model has a relation named "parentNode"Admin interface hangs on models with "parentNode" field .
Triage Stage: UnreviewedAccepted
Type: UncategorizedBug
Version: 2.2master

Thanks for the report. I reproduced this issue but it is not related with any of Django's JS. jQuery hangs even if CharField is named parentNode. You can try to look for a help on jQuery support channels. Personally, I would try to avoid using DOM properties as a field names.

Closing per TicketClosingReasons/UseSupportChannels

Note: See TracTickets for help on using tickets.
Back to Top