Documentation inconsistency
rianradeck opened this issue · 1 comments
rianradeck commented
The tutorial file flaskr/blog.py does not check if the body is empty, but the body must be not null according to flaskr/schema.sql.
The following methods in flaskr/blog.py and their respective views are affected by this:
- create
- update
To replicate, create a blog post with an empty body.
The expected behavior shouldn't let the user create the post with an empty body.
I vision two possible solutions:
- Add verification for an empty body in necessary parts of the code.
- Let the body be NULL in the flaskr/schema.sql.
Environment: Ubuntu 20.04.6 LTS
- Python version: 3.8.10
- Flask version: 2.3.2
davidism commented
The empty string is not the same as NULL
. The value must not be null. It may be empty.