Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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
  • Loading branch information...
commit babc0793e3dcfcc976ae44df4c67c7eed627655c 1 parent fb509ee
@malcolmt malcolmt authored
Showing with 4 additions and 4 deletions.
  1. +4 −4 django/db/models/related.py
View
8 django/db/models/related.py
@@ -104,12 +104,12 @@ def get_manipulator_fields(self, opts, manipulator, change, follow):
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
Please sign in to comment.
Something went wrong with that request. Please try again.