diff options
Diffstat (limited to 'django/forms/models.py')
| -rw-r--r-- | django/forms/models.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/django/forms/models.py b/django/forms/models.py index 820a30b667..56e94fe9e7 100644 --- a/django/forms/models.py +++ b/django/forms/models.py @@ -687,7 +687,7 @@ class BaseModelFormSet(BaseFormSet): else: return ugettext("Please correct the duplicate data for %(field)s, " "which must be unique.") % { - "field": get_text_list(unique_check, six.text_type(_("and"))), + "field": get_text_list(unique_check, six.text_type(_("and"))), } def get_date_error_message(self, date_check): @@ -1042,8 +1042,8 @@ class ModelChoiceIterator(object): yield self.choice(obj) def __len__(self): - return len(self.queryset) +\ - (1 if self.field.empty_label is not None else 0) + return (len(self.queryset) + + (1 if self.field.empty_label is not None else 0)) def choice(self, obj): return (self.field.prepare_value(obj), self.field.label_from_instance(obj)) |
