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 a schema that defines a single non-empty text field and sets the controls that allow additional fields and filters them. The schema looks like this:
The form renderer adds a csrf token and then the form is submitted by the user. The view code runs again and after validating (and stripping of attributes not in my schema) the form.data dictionary looks like this:
Just before the validation code, all form values are added to the data attribute.
Thinking about it though this makes sense because otherwise one value being invalid would cause all form data being removed.
This does mean that the CSRF checking code should not get the value, but pop it from the MultiDict. This way, it will not be present when the form gets rendered and the csrf placing code will do its intended action.
Although, the better solution would probably be to correc the csrf method to not render through the hidden method which does a lookup of the _csrf key through value where the correct CSRF key becomes a default and not the override value.
I have a schema that defines a single non-empty text field and sets the controls that allow additional fields and filters them. The schema looks like this:
It is then processed in the following view code:
The form renderer adds a csrf token and then the form is submitted by the user. The view code runs again and after validating (and stripping of attributes not in my schema) the form.data dictionary looks like this:
The attributes that should have been stripped out have not been.
Performing a standalone
to_python
on my Message schema does work as expected (only the message gets returned, and when empty, Invalid is raised.This causes me trouble because I'm resetting the csrf token on every successful post, but the old csrf value keeps coming back.
The text was updated successfully, but these errors were encountered: