From babc0793e3dcfcc976ae44df4c67c7eed627655c Mon Sep 17 00:00:00 2001 From: Malcolm Tredinnick Date: Mon, 19 Feb 2007 04:18:46 +0000 Subject: [PATCH] Fixed behaviour of admin interface (and AddManipulator) when min/max_num_in_admin is specified without num_in_admin. A consequence of changes in [4500]. git-svn-id: http://code.djangoproject.com/svn/django/trunk@4542 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/db/models/related.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/django/db/models/related.py b/django/db/models/related.py index b76da34079..a63f09b745 100644 --- a/django/db/models/related.py +++ b/django/db/models/related.py @@ -104,12 +104,12 @@ class RelatedObject(object): attr = getattr(manipulator.original_object, self.get_accessor_name()) count = attr.count() count += self.field.rel.num_extra_on_change - if self.field.rel.min_num_in_admin: - count = max(count, self.field.rel.min_num_in_admin) - if self.field.rel.max_num_in_admin: - count = min(count, self.field.rel.max_num_in_admin) else: count = self.field.rel.num_in_admin + if self.field.rel.min_num_in_admin: + count = max(count, self.field.rel.min_num_in_admin) + if self.field.rel.max_num_in_admin: + count = min(count, self.field.rel.max_num_in_admin) else: count = 1