diff --git a/django/contrib/admin/widgets.py b/django/contrib/admin/widgets.py
index f1002cac6c..ea431d277f 100644
a
|
b
|
import json
|
6 | 6 | |
7 | 7 | from django import forms |
8 | 8 | from django.conf import settings |
| 9 | from django.contrib.admin.utils import quote |
9 | 10 | from django.core.exceptions import ValidationError |
10 | 11 | from django.core.validators import URLValidator |
11 | 12 | from django.db.models import CASCADE |
… |
… |
class ForeignKeyRawIdWidget(forms.TextInput):
|
184 | 185 | obj._meta.app_label, |
185 | 186 | obj._meta.object_name.lower(), |
186 | 187 | ), |
187 | | args=(obj.pk,) |
| 188 | args=(quote(obj.pk),) |
188 | 189 | ) |
189 | 190 | except NoReverseMatch: |
190 | 191 | url = '' # Admin not registered for target model. |