#6101 closed (fixed)
Seeing ", etc. in admin list of related object to be deleted
Reported by: | Owned by: | anonymous | |
---|---|---|---|
Component: | contrib.admin | Version: | newforms-admin |
Severity: | Keywords: | autoescape nfa-someday | |
Cc: | Triage Stage: | Accepted | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
I'm seeing ", etc. in the admin list of related objects to be deleted, when the related objects are edited inline and therefore do not have an associated link:
Are you sure you want to delete the puzzles "NYT Sat 2007-11-17"? All of the following related items will be deleted: * Puzzles: NYT Sat 2007-11-17 o Clues: CAMPHOROIL: Liniment ingredient o Clues: MITA: Certain copier o Clues: UNITARIANS: Presidents Adams, Fillmore and Taft o Clues: APIN: "... on the head of ____?"
It looks like there's a missing mark_safe around where these items are created (after the object representation has been escaped) on line 57 here:
I think it should be:
nh(deleted_objects, current_depth, [mark_safe(u'%s: %s' % (force_unicode(capfirst(related.opts.verbose_name)), escape(sub_obj))), []])
Making this change gets rid of the "s I see in my list of related items to be deleted -- they display as quotes.
Hmm, I just noticed a few lines up (line 41) in the code for the OneToOne case that there seems to be a missing escape around sub_obj:
Shouldn't that also be:
nh(deleted_objects, current_depth, [mark_safe(u'%s: %s' % (force_unicode(capfirst(related.opts.verbose_name)), escape(sub_obj))), []])
?
Change History (9)
comment:1 by , 17 years ago
Component: | Uncategorized → Admin interface |
---|
comment:2 by , 17 years ago
comment:3 by , 17 years ago
Ticket #5490 is a bit related: also the links to the objects being deleted are not escaped correctly...
comment:5 by , 17 years ago
comment:6 by , 17 years ago
Keywords: | nfa-someday added |
---|---|
Owner: | changed from | to
Status: | new → assigned |
This display wart should not block the merge of newforms-admin to trunk, besides, the same problem exists on trunk too.
comment:8 by , 16 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
The corresponding code in the trunk (located in a different place) seems to have the same problems here:
http://code.djangoproject.com/browser/django/trunk/django/contrib/admin/views/main.py#L457
and here:
http://code.djangoproject.com/browser/django/trunk/django/contrib/admin/views/main.py#L441