This commit is contained in:
j3d1 2024-06-18 15:26:37 +02:00
parent 69ce11c331
commit 75798e38e4

View file

@ -122,6 +122,13 @@ class IssueSerializer(serializers.ModelSerializer):
'timestamp': relation.timestamp,
'item': ItemSerializer(relation.item).data,
})
for shipping_code in obj.shipping_codes.all():
timeline.append({
'type': 'shipping_code',
'id': shipping_code.id,
'timestamp': shipping_code.used_at,
'code': ShippingCodeSerializer(shipping_code).data,
})
return sorted(timeline, key=lambda x: x['timestamp'])
def get_queryset(self):