Django ModelForm fails validation with no errors

前端 未结 4 623
不知归路
不知归路 2021-02-14 02:37

Ok, I have been staring at this for hours trying to figure out what\'s going on, to no avail. I am trying to create a ModelForm using the \'instance\' keyword to pass it an exi

4条回答
  •  广开言路
    2021-02-14 02:49

    This isn't a solution for OP, but it is for the post title, which is quite high in Google. So I'll post it anyway, from here:

    If you're already giving request.POST to your form using request.POST or None, but it's still invalid without errors, check that there isn't any redirect going on. A redirect loses your POST data and your form will be invalid with no errors because it's unbound.

提交回复
热议问题