Topic: for loop mysteriously not executing
Here is the the that is not executing for some reason:
def sum_order_by_type(type, order)
for line_item in order.finished_line_items
#sum = 0/0
if line_item.typeID == type.id
sum += line_item.qty
The strange thing is that if I uncomment the two commented lines, a divide by zero error does not occur, meaning that the for loop has not been iterated, but, order.finished_line_items.count returns the correct amount! I cannot figure out why the loop will not iterate.