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
In wtforms/src/wtforms/fields/core.py (as of writing, lines 333-337):
if formdata is not None:
if self.name in formdata:
self.raw_data = formdata.getlist(self.name)
else:
self.raw_data = []
If the code enters the else statement, it silently causes no data to return back from your form without giving an indication as to why. This can occur if you set the name attribute of a field after the instantiation of that field, for example, when one tries to create fields with dynamic names and values.
Suggested fix: throw an error in the else statement that describes what causes your form not to return any data, something along the lines of "The name of this field changed between instantiation and the form being submitted; this is not allowed"
The text was updated successfully, but these errors were encountered:
I don't think this behavior should change, at least not in the way described here. If you're changing the name after submitting the form, that's a problem you need to fix in your code, as you're not applying it consistently before and after submitting, otherwise the names would match. This seems like a specific case of #402.
In wtforms/src/wtforms/fields/core.py (as of writing, lines 333-337):
If the code enters the else statement, it silently causes no data to return back from your form without giving an indication as to why. This can occur if you set the name attribute of a field after the instantiation of that field, for example, when one tries to create fields with dynamic names and values.
Suggested fix: throw an error in the else statement that describes what causes your form not to return any data, something along the lines of "The name of this field changed between instantiation and the form being submitted; this is not allowed"
The text was updated successfully, but these errors were encountered: