Fixed typo

This commit is contained in:
2019-03-11 07:27:54 +01:00
parent 0401acd31b
commit 416d7fdd6d
7 changed files with 30 additions and 43 deletions

View File

@@ -29,6 +29,10 @@ class handler(asyncTornado.asyncRequestHandler):
args_filter = asyncTornado.check_arguments(self.request.arguments, ARGS)
if False in args_filter:
raise Exception("Missing required arguments")
print()
print(args_filter)
print()
method = args_filter[0]
method_value = self.request.arguments[method]
@@ -44,14 +48,16 @@ class handler(asyncTornado.asyncRequestHandler):
cur.execute(sql)
data = cur.fetchone()
cur.close()
status_code = 200
except Exception as e:
status_code = 400
data["status"] = status_code
data["message"] = e
finally:
cur.close()
print(data)
self.write( json.dumps(data) )
self.set_header("Content-Type", "application/json")
self.set_status(status_code)