diff options
| author | Claude Paroz <claude@2xlibre.net> | 2013-11-20 21:34:29 +0100 |
|---|---|---|
| committer | Claude Paroz <claude@2xlibre.net> | 2013-11-20 21:37:35 +0100 |
| commit | d8fdee7db877e3a52a761bfcbeb3536ea219ec30 (patch) | |
| tree | c0c9a7b7847f62cf48305395c85d72a3369e7776 /django | |
| parent | 6f48ae0b0ffc42f63487f482d668507d986790df (diff) | |
[1.6.x] Fixed #21472 -- Fixed inline formsets display when parent pk is 0
Thanks agale031176@gmail.com for the report.
Backport of fafb6cf049b from master.
Diffstat (limited to 'django')
| -rw-r--r-- | django/forms/models.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/django/forms/models.py b/django/forms/models.py index 67f8778c46..5c4fe4bbdf 100644 --- a/django/forms/models.py +++ b/django/forms/models.py @@ -831,7 +831,7 @@ class BaseInlineFormSet(BaseModelFormSet): self.save_as_new = save_as_new if queryset is None: queryset = self.model._default_manager - if self.instance.pk: + if self.instance.pk is not None: qs = queryset.filter(**{self.fk.name: self.instance}) else: qs = queryset.none() |
