From fa005f6366fcefaaab0a9aab61f87ea017022d4e Mon Sep 17 00:00:00 2001 From: bvn13 Date: Fri, 11 Oct 2024 23:08:51 +0300 Subject: [PATCH] fix --- .gitignore | 4 +++- src/main.py | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 3333883..43c515e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ +.idea +.idea/** local.env **/*.pyc -test/ \ No newline at end of file +test/ diff --git a/src/main.py b/src/main.py index 4907187..d3c4833 100644 --- a/src/main.py +++ b/src/main.py @@ -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