fix
This commit is contained in:
parent
623f63c18c
commit
fa005f6366
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,3 +1,5 @@
|
||||
.idea
|
||||
.idea/**
|
||||
local.env
|
||||
**/*.pyc
|
||||
test/
|
@ -48,7 +48,7 @@ class RequireJSON:
|
||||
)
|
||||
|
||||
if req.method in ('POST', 'PUT'):
|
||||
if req.content_type == None or 'application/json' not in req.content_type:
|
||||
if req.content_type is None or 'application/json' not in req.content_type:
|
||||
raise falcon.HTTPUnsupportedMediaType(
|
||||
title='This API only supports requests encoded as JSON.',
|
||||
href='http://docs.examples.com/api/json',
|
||||
@ -158,7 +158,7 @@ class CreateTaskResource:
|
||||
is_waiting_empty_line = False
|
||||
with open(file_path, 'r', encoding='UTF-8') as file:
|
||||
while line := file.readline():
|
||||
if section_found == False:
|
||||
if not section_found:
|
||||
if line.strip() == CreateTaskResource.TODO_HEADER:
|
||||
section_found = True
|
||||
is_waiting_empty_line = True
|
||||
|
Loading…
Reference in New Issue
Block a user