Opened 4 years ago

Closed 3 years ago

#17596 closed Bug (fixed)

Safestring in Admin Field Label quoted twice

Reported by: guettli Owned by: nobody
Component: contrib.admin Version: master
Severity: Normal Keywords:
Cc: hv@… Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no


A Safestring in and admin field label gets quoted twice. Patch with unittest attached.

The patch is against trunk (updated today) and all unittests pass.

Attachments (2)

safestring_in_admin_field_label.patch (3.9 KB) - added by guettli 4 years ago.
17594-2.diff (3.3 KB) - added by claudep 4 years ago.
Use conditional_escape for AdminField label

Download all attachments as: .zip

Change History (7)

comment:1 Changed 4 years ago by guettli

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

I am updating the patch ...

Changed 4 years ago by guettli

comment:2 Changed 4 years ago by guettli

  • Patch needs improvement unset

Improved test. All django unittests pass.

comment:3 Changed 4 years ago by claudep

  • Triage Stage changed from Unreviewed to Accepted

I don't see right away a good use case to pass a SafeString to a form label. Anyway, it does not harm to replace an escape by a conditional_escape, but no need to touch forms/ for that (unless you show by a test that there is a problem there). I'm attaching my way of fixing this.

Changed 4 years ago by claudep

Use conditional_escape for AdminField label

comment:4 Changed 4 years ago by guettli

  • Triage Stage changed from Accepted to Ready for checkin

Thank you claudep. Your solution (17594-2.diff) is better. I tested it, all unittests pass. I think it is read to commit.

comment:5 Changed 3 years ago by jezdez

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

In [17431]:

Fixed #17596 -- Stopped the AdminField class from double quoting its label. Thanks, guettli and claudep.

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