Currently, if you create a field with {{ form.myfield(readonly=true) }} or {{ form.myfield(disabled=true) }} you still need to do this to prevent the disabled/readonly fields from getting saved:
def edit_team():
form = TeamForm(request.POST, obj=team)
del form.myfield
if request.POST and form.validate():
form.populate_obj(team)
return redirect('/teams')
return render('edit_team.html')
Would it cause any problems if WTForms deleted disabled/readonly fields from the form by default (to improve security)?
Currently, if you create a field with
{{ form.myfield(readonly=true) }}or{{ form.myfield(disabled=true) }}you still need to do this to prevent the disabled/readonly fields from getting saved:Would it cause any problems if WTForms deleted disabled/readonly fields from the form by default (to improve security)?