Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow hooking invalid form submission for a WizardView step #157

Open
KyeRussell opened this issue Nov 15, 2019 · 3 comments
Open

Allow hooking invalid form submission for a WizardView step #157

KyeRussell opened this issue Nov 15, 2019 · 3 comments

Comments

@KyeRussell
Copy link

Looking here:

https://github.com/jazzband/django-formtools/blob/master/formtools/wizard/views.py#L294

It appears that there is no way for me to do anything when a step's form submission fails, without overriding all of post() to put an else: on the if form.is_valid() conditional.

Firstly, am I right in this assertion?

If so, it'd be beneficial for me personally to have this ability. I don't want to intercept and provide a new response, I just need to do some background logging.

@KyeRussell KyeRussell changed the title Allow hooking invalid form submission for a step Allow hooking invalid form submission for a WizardView step Nov 15, 2019
@frague59
Copy link

Hi,

I've the same issue, it should be very interesting to add this hook for step validations : I've some ModelForm + ModelFormset (having the ModelForm as FK of the ModelFormset) that could benefit of it.
For now, I validate the formset with client-side JS, which is not perfect, because I do not want to hack the post() method...

@KyeRussell
Copy link
Author

My particular issue was sidestepped by messing with some form code. It is not ideal in my case, and can foresee circumstances in which I'd still want my original request.

@TTorture
Copy link

I might have a similar issue: I have two steps using a ModelForm and a ModelFormset.. One of these forms does not validate and I am lacking a proper way to log or debug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants