Skip to content

Commit

Permalink
[!] fix return value data=None
Browse files Browse the repository at this point in the history
  • Loading branch information
ZhongFuze committed May 23, 2024
1 parent 14157e7 commit d05f888
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/controller/allocation_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Author: Zella Zhong
Date: 2024-05-23 22:47:04
LastEditors: Zella Zhong
LastEditTime: 2024-05-24 04:52:22
LastEditTime: 2024-05-24 05:20:48
FilePath: /id_allocation/src/controller/allocation_controller.py
Description: allocation controller
'''
Expand Down Expand Up @@ -50,12 +50,12 @@ def allocation(self):
updated_nanosecond = data.get("updated_nanosecond", 0)
vids = data.get("vids", [])
if graph_id == "" or updated_nanosecond == 0:
return httpsvr.Resp(msg="Invalid input body", data={}, code=-1)
return httpsvr.Resp(msg="Invalid input body", data=None, code=-1)
if len(vids) == 0:
return httpsvr.Resp(msg="Invalid input body", data={}, code=-1)
return httpsvr.Resp(msg="Invalid input body", data=None, code=-1)


data = {}
data = None
rows = []
code = 0
msg = ""
Expand All @@ -71,7 +71,7 @@ def allocation(self):
if len(rows) == 0:
cursor.close()
pg_conn.close()
return httpsvr.Resp(msg="allocation ID=null", data={}, code=-1)
return httpsvr.Resp(msg="allocation ID=null", data=None, code=-1)

data = rows[0]
cursor.close()
Expand Down

0 comments on commit d05f888

Please sign in to comment.