From 559c0da7c141488e5d7c6bc0ef54f27dca53ca42 Mon Sep 17 00:00:00 2001 From: Malcolm Tredinnick Date: Wed, 3 Sep 2008 21:16:05 +0000 Subject: [PATCH] Fixed a small initialisation edge-case in the raw_id_fields section of admin. git-svn-id: http://code.djangoproject.com/svn/django/trunk@8951 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/contrib/admin/widgets.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/django/contrib/admin/widgets.py b/django/contrib/admin/widgets.py index bad4702d92..f9ddf9acd9 100644 --- a/django/contrib/admin/widgets.py +++ b/django/contrib/admin/widgets.py @@ -105,6 +105,8 @@ class ForeignKeyRawIdWidget(forms.TextInput): super(ForeignKeyRawIdWidget, self).__init__(attrs) def render(self, name, value, attrs=None): + if attrs is None: + attrs = {} related_url = '../../../%s/%s/' % (self.rel.to._meta.app_label, self.rel.to._meta.object_name.lower()) params = self.url_parameters() if params: