Code

Opened 6 years ago

Closed 6 years ago

#6983 closed (fixed)

error class in edit_inline objects has quotes escaped

Reported by: bbolli <me+django@…> Owned by: nobody
Component: contrib.admin Version: master
Severity: Keywords: auto-escape nfa-fixed
Cc: Triage Stage: Fixed on a branch
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

When missing to enter a required field in inline related models, the top of the forms says correctly to "fix the error below" (or similar; I'm running on a Swiss German system), but below, no errors are displayed. This is because of an auto-escaping bug in admin/views/base.py. See the patch for a possible fix.

Attachments (2)

base.py.patch (432 bytes) - added by bbolli <me+django@…> 6 years ago.
Auto-escaping patch
6893.diff (585 bytes) - added by dan90 6 years ago.
patch to fix quoting of added classes in inline edit in oldforms-admin

Download all attachments as: .zip

Change History (7)

Changed 6 years ago by bbolli <me+django@…>

Auto-escaping patch

comment:1 Changed 6 years ago by bbolli <me+django@…>

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

Sorry, the patch is not relative to the Django root. Please apply the patch in the directory django/django/contrib/admin/views. Thanks.

comment:2 Changed 6 years ago by telenieko

  • Triage Stage changed from Unreviewed to Accepted

Note that this happens with edit_inline_tabular. I'm not sure this will be fixed as there's a strong effort to get newforms-admin in trunk ASAP.

Changed 6 years ago by dan90

patch to fix quoting of added classes in inline edit in oldforms-admin

comment:3 Changed 6 years ago by dan90

hm, as of r7823, this bug still occurred both with STACKED and TABULAR inline editing- and the patch, if applied to contrib/admin/views/main.py, as i assume the intention of the submitter it seems to work alright.

I've re-rolled the patch in the project root and attached it.

comment:4 Changed 6 years ago by Karen Tracey <kmtracey@…>

  • Keywords nfa-fixed added
  • Triage Stage changed from Accepted to Fixed on a branch

Note this appears to be an old admin problem only; I cannot recreate on newforms-admin. If I leave out required field(s) and try to save I see the appropriate error(s) on the field(s) that fail validation. The overall error at the top is missing, but that is a different problem with its own ticket (#5628). I don't know that it is worth fixing for old admin at this point.

comment:5 Changed 6 years ago by brosner

  • Resolution set to fixed
  • Status changed from new to closed

This is no longer a problem since the merge of newforms-admin in [7967].

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.