On_next step validation takes too long

We have an app that performs several validation checks in a step using the on_next parameter. The checks don’t take that much time for one file, but when selecting many files an error is returned stating that the step validation process takes too long. This limits the number of files a user can select.

Is it possible to set some kind of duration guess parameter, like we can do for a view? Or is there perhaps another workaround?

image

Hi Martijn,

it is not possible to configure the maximum duration of the step validation step. We have introduced this limit because we believe a long validation duration would lead to an annoying user experience if you have to go back and forth trough the steps.

We assumed that normally validation should be very quick, but i can imagine that if you have to parse a lot of files this grows quite quickly. Would you be helped with a validation function that is triggered when the user uploads the file? This has multiple benefits:

  • the user immediately gets feedback upon uploading
  • the step validation doesn’t need to cover this anymore

A possible workaround for you might be a SetParamsButton “Validate files” next to the files, which sets a boolean True | False on an invisible files_are_validated=BooleanField, which is then checked on the step validation.

Hi Matthijs,

Thanks for your response! It would be nice to carry out a validation function immediately when a user uploads a file, like you suggest. In an older release of our app we uploaded a file using this file-like entity type approach that is described in de docs. This allowed us to carry out validation steps in a separate controller. Something similar for FileFields would be nice! For now we’ll probably use your suggestion.

1 Like