The use case that I am trying to solve is the requirement that the user upload the file before they are allowed to go to the next step in the form process.
To achieve this, I have a Django form to capture general user information that POSTS matches Django 'A' view. The form is displayed using a template that also includes an iFrame with a simple built-in button that links to the Django "B" view URL.
View 'B' simply sets the session variable, indicating that the download has occurred, and returns the URL of the file being downloaded, thereby causing the download.
As part of checking form “A” (main form), I need to check if a session variable is set indicating the file is loading.
My question is: is it better to do this using the “A” form verification procedure, and if so, how is this achieved?
If this is not a good approach, where should this event be tested?
source
share