fix --> batch_identity Nonetype in distribution batch

This commit is contained in:
2026-01-21 14:52:41 +03:30
parent e44121b10b
commit f2aab5c6b6

View File

@@ -202,7 +202,7 @@ class TagDistributionBatchSerializer(serializers.ModelSerializer):
representation['distributions'] = [{
'id': dist.id,
'dist_identity': dist.dist_identity,
'batch_identity': dist.batch.batch_identity,
'batch_identity': dist.batch.batch_identity if dist.batch else None,
'species_code': dist.species_code,
'distributed_number': dist.distributed_number,
'serial_from': dist.batch.serial_from if dist.batch else None,