Fixed a bug where it was already index 0 that was popped from the missing bricks list

This commit is contained in:
2024-03-04 14:10:56 -05:00
parent 52eeab7042
commit a23205060c
2 changed files with 50 additions and 36 deletions

2
app.py
View File

@@ -58,7 +58,7 @@ def save_number(tmp):
elif number == '0':
for idx,i in enumerate(json_file['unit'][int(index)]['bricks']['missing']):
if i['brick']['ID'] == part_num and i['brick']['is_spare'] == is_spare and i['brick']['color_name'] == color:
json_file['unit'][int(index)]['bricks']['missing'].pop(0)
json_file['unit'][int(index)]['bricks']['missing'].pop(idx)
else:
found = False