You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have updated my project requirements from django-formtools 2.3 to 2.5.1. However some of my tests using WizardView are now broken and I can sort of bisect the problem between the 2.3.0 and 2.4.0 version.
Suppose a form where you're asked to upload an Excel file and process some data in it, you may need to select a sheet if multiple are present in the file, but that step can be ignored if the file has a single sheet. The WizardView would look like this:
In formtools 2.3 version, get_cleaned_data_for_step is returning None when the excel_sheet_selection step is passed (e.g because is_sheet_selection_needed returned False because there's a single sheet in the file in our case)
In formtools 2.4 and after, I get the following exception:
I guess the change happened with the issue #168 that is using get_form_list most of the time except in the first line of get_cleaned_data_step:
defget_cleaned_data_for_step(self, step):
""" Returns the cleaned data for a given `step`. Before returning the cleaned data, the stored values are revalidated through the form. If the data doesn't validate, None will be returned. """ifstepinself.form_list: # <---- Based on form_list declaration while get_form will hit `self.get_form_list()[step]` laterform_obj=self.get_form(
By looking at the doc, this behaviour was undefined (it doesn't say if it should return None or raise an exception), but I think it should be clarified, either through a more explicit/nicer exception ("excel_sheet_selection step not found in forms submitted") or by returning None as before.
I have an easy way to fix that (by checking myself if the form is in get_form_list) but that feels wonky since the lib was doing it for me before.
The text was updated successfully, but these errors were encountered:
I have updated my project requirements from django-formtools 2.3 to 2.5.1. However some of my tests using
WizardView
are now broken and I can sort of bisect the problem between the 2.3.0 and 2.4.0 version.Suppose a form where you're asked to upload an Excel file and process some data in it, you may need to select a sheet if multiple are present in the file, but that step can be ignored if the file has a single sheet. The WizardView would look like this:
In formtools 2.3 version,
get_cleaned_data_for_step
is returning None when theexcel_sheet_selection
step is passed (e.g becauseis_sheet_selection_needed
returned False because there's a single sheet in the file in our case)In formtools 2.4 and after, I get the following exception:
I guess the change happened with the issue #168 that is using
get_form_list
most of the time except in the first line ofget_cleaned_data_step
:By looking at the doc, this behaviour was undefined (it doesn't say if it should return None or raise an exception), but I think it should be clarified, either through a more explicit/nicer exception ("
excel_sheet_selection
step not found in forms submitted") or by returning None as before.I have an easy way to fix that (by checking myself if the form is in
get_form_list
) but that feels wonky since the lib was doing it for me before.The text was updated successfully, but these errors were encountered: