Commit 5756af86 by Aeolus

update

parent f7031bdf
...@@ -58,12 +58,14 @@ def create_rent(): ...@@ -58,12 +58,14 @@ def create_rent():
left_count = count left_count = count
for i in hatch_list: for i in hatch_list:
if i.left_count <= left_count: if i.left_count <= left_count:
left_count = left_count - i.left_count
hatch_no_dict = {i.hatch_no: i.left_count} hatch_no_dict = {i.hatch_no: i.left_count}
left_count = left_count - i.left_count
else: else:
hatch_no_dict = {i.hatch_no: left_count} hatch_no_dict = {i.hatch_no: left_count}
left_count = 0 left_count = 0
open_hatchs.append(hatch_no_dict) open_hatchs.append(hatch_no_dict)
if left_count <= 0:
break
if left_count > 0: if left_count > 0:
return jsonify(HATCH_COUNT_ERROR) return jsonify(HATCH_COUNT_ERROR)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment