Opened 12 years ago

Closed 12 years ago

#17596 closed Bug (fixed)

Safestring in Admin Field Label quoted twice

Reported by: Thomas Güttler Owned by: nobody
Component: contrib.admin Version: dev
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

Description

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 Thomas Güttler 12 years ago.
17594-2.diff (3.3 KB ) - added by Claude Paroz 12 years ago.
Use conditional_escape for AdminField label

Download all attachments as: .zip

Change History (7)

comment:1 by Thomas Güttler, 12 years ago

Patch needs improvement: set

I am updating the patch ...

by Thomas Güttler, 12 years ago

comment:2 by Thomas Güttler, 12 years ago

Patch needs improvement: unset

Improved test. All django unittests pass.

comment:3 by Claude Paroz, 12 years ago

Triage Stage: UnreviewedAccepted

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/forms.py for that (unless you show by a test that there is a problem there). I'm attaching my way of fixing this.

by Claude Paroz, 12 years ago

Attachment: 17594-2.diff added

Use conditional_escape for AdminField label

comment:4 by Thomas Güttler, 12 years ago

Triage Stage: AcceptedReady 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 by Jannis Leidel, 12 years ago

Resolution: fixed
Status: newclosed

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