Skip to content

Commit

Permalink
Prevent needless revalidation at end.
Browse files Browse the repository at this point in the history
All the forms have been through validation before calling done(),
and get_all_cleaned_data() would repeat all that, so instead just
construct the combined cleaned data dictionary ourselves.
  • Loading branch information
dracos committed Apr 28, 2017
1 parent 0e1ed96 commit a6835fa
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion bulk_lookup/views.py
Expand Up @@ -124,7 +124,10 @@ def get_context_data(self, form, **kwargs):
return context

def done(self, form_list, form_dict, **kwargs):
data = self.get_all_cleaned_data()
data = {}
for form_obj in form_list:
data.update(form_obj.cleaned_data)

output_options = data.pop('output_options')
bulk_lookup = BulkLookup.objects.create(**data)
bulk_lookup.output_options.add(*output_options)
Expand Down

0 comments on commit a6835fa

Please sign in to comment.