From b63157c616104d19a92a7b9793693c73e4d047c5 Mon Sep 17 00:00:00 2001 From: Adrian Holovaty Date: Fri, 26 May 2006 17:54:19 +0000 Subject: [PATCH] Fixed #1403 -- 'Add' green plus sign no longer appears in admin change forms for fields whose related models don't have an admin git-svn-id: http://code.djangoproject.com/svn/django/trunk@2991 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/contrib/admin/views/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/django/contrib/admin/views/main.py b/django/contrib/admin/views/main.py index 025b7d28ed..d9ac07c11b 100644 --- a/django/contrib/admin/views/main.py +++ b/django/contrib/admin/views/main.py @@ -118,7 +118,7 @@ class AdminBoundField(object): self.raw_id_admin = use_raw_id_admin(field) self.is_date_time = isinstance(field, models.DateTimeField) self.is_file_field = isinstance(field, models.FileField) - self.needs_add_label = field.rel and isinstance(field.rel, models.ManyToOneRel) or isinstance(field.rel, models.ManyToManyRel) and field.rel.to._meta.admin + self.needs_add_label = field.rel and (isinstance(field.rel, models.ManyToOneRel) or isinstance(field.rel, models.ManyToManyRel)) and field.rel.to._meta.admin self.hidden = isinstance(self.field, models.AutoField) self.first = False