D
D
difficultnicknameforcommu2017-11-30 00:19:29
Flask
difficultnicknameforcommu, 2017-11-30 00:19:29

How to fix a form in Flask?

There is a small application on flask. There is a standard authorization form in which user.id is written in flask.session.
The problem is that the form is always invalidated (via form.validate_on_submit()). And this only happens on a home macbook. On all other machines (working (linux) and server (linux server)) everything works as it should.
form.validate() and form.validate_on_submit() always return False.
there are no errors in form.errors.
csrf_token is set and displayed correctly in the template, all data is received normally in the controller. I tried to output csrf via form.hidden_tag(), it didn't help.
The project uses:
Flask (0.12.2)
Flask-WTF (0.14.2)
WTForms (2.1)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Pavel, 2017-11-30
@difficultnicknameforcommu

Possible reason - old cookies. We changed the logic of the validation, and the old data remained in the cookies.
Try clearing your cookies/opening the page in private mode.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question