Skip to content

Commit

Permalink
modelformset factory queryset needs an empty queryset not just a None…
Browse files Browse the repository at this point in the history
… to not populate the formaset with the default data
  • Loading branch information
rwblair committed Oct 4, 2016
1 parent c3c45d6 commit 4c102f6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions open_fmri/apps/dataset/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,12 @@ def get_context_data(self, **kwargs):
context['revision_formset_helper'] = RevisionFormSetHelper()
if self.object:
context['contact_formset'] = ContactFormSet(
queryset=self.object.contacts.all(),
queryset=object.contacts.all(),
)
else:
context['contact_formset'] = ContactFormSet()
context['contact_formset'] = ContactFormSet(
queryset=Contact.objects.none()
)
context['contact_formset_helper'] = ContactFormSetHelper()
return context

Expand Down

0 comments on commit 4c102f6

Please sign in to comment.