1
0
mirror of https://github.com/django/django.git synced 2025-11-07 07:15:35 +00:00

Fixed #20664 -- Fixed a bug with raw_id_fields on Python 3.

Thanks jefftriplett for the report.
This commit is contained in:
Tim Graham
2013-06-27 19:39:20 -04:00
parent c1284c3d3c
commit 534ced5aad
2 changed files with 11 additions and 3 deletions

View File

@@ -11,7 +11,7 @@ from django.contrib.admin.templatetags.admin_static import static
from django.core.exceptions import ObjectDoesNotExist
from django.db import models
from django.utils import formats
from django.utils.html import format_html
from django.utils.html import escapejs, format_html
from django.utils.safestring import mark_safe
from django.utils.text import capfirst
from django.utils.translation import ugettext as _
@@ -226,12 +226,12 @@ def items_for_result(cl, result, form):
else:
attr = pk
value = result.serializable_value(attr)
result_id = repr(force_text(value))[1:]
result_id = escapejs(value)
yield format_html('<{0}{1}><a href="{2}"{3}>{4}</a></{5}>',
table_tag,
row_class,
url,
format_html(' onclick="opener.dismissRelatedLookupPopup(window, {0}); return false;"', result_id)
format_html(' onclick="opener.dismissRelatedLookupPopup(window, &#39;{0}&#39;); return false;"', result_id)
if cl.is_popup else '',
result_repr,
table_tag)