Infinite Recursion possible in 2.4
See original GitHub issueWe have a condition_dict containing the following function:
def need_further_steps(wizard):
    data = wizard.get_cleaned_data_for_step("0") or {}
    if data.get("no_invoices_needed", False):
        return False
    return True
The call to WizardView.get_cleaned_data_for_step then calls WizardView.get_form, which used to reference self.form_list, but the following commit changes this to self.get_form_list(), which then calls the user-supplied condition_dict functions, which then calls our need_further_steps function above, which calls WizardView.get_cleaned_data_for_step, and so on ad infinitum.
https://github.com/jazzband/django-formtools/commit/533a83053deab2adeb72de079e813aae78b03c1a
Perhaps our custom condition function is bad, but it doesn’t seem too unreasonable?
Issue Analytics
- State:
 - Created a year ago
 - Reactions:1
 - Comments:37 (21 by maintainers)
 
Top Results From Across the Web
Infinite Recursion with Jackson JSON and Hibernate JPA issue
Since Jackson 1.6 you can use two annotations to solve the infinite recursion problem without ignoring the getters/setters during serialization: ...
Read more >Adding package to devShell causes `error: stack overflow ...
The problem is that it's hard to give a useful error message in case of a stack overflow. You can't throw an exception...
Read more >Out of memory. The likely cause is an infinite recursion within ...
I'm trying to apply the secant method to the function defined in fv, but I keep getting the out of memory message. ·...
Read more >Appendix A Debugging - Green Tea Press
Infinite Recursion. Most of the time, infinite recursion causes the program to run for a while and then produce a Maximum recursion depth...
Read more >What is infinite recursion? - Quora
Infinite recursion happens when a recursive function fails to stop recursing. Unless the design specification for the function says it should abuse resources ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Please revert 533a83053, which introduced a major bug and was not a proper solution for the new feature request (to dynamically add forms that aren’t in the initial
form_list). For those that require this new feature, please provide a working example of your use cases and how you were doing this prior to 2.4. A proper API needs to be created and tested for this new feature request, without breaking existing documented functionality. That has not been done yet. A proper API shouldn’t require any hacks around infinite recursion errors, it should be designed so these errors are impossible.The latter - to come up with a proper solution.