From eef768e3600c96ea9ade308e3f6da41d2051384d Mon Sep 17 00:00:00 2001 From: Mojtaba-z Date: Wed, 21 Jan 2026 09:40:25 +0330 Subject: [PATCH] fix --> non batch in tag distribution --- apps/tag/web/api/v1/serializers.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/apps/tag/web/api/v1/serializers.py b/apps/tag/web/api/v1/serializers.py index fcc910c..487389e 100644 --- a/apps/tag/web/api/v1/serializers.py +++ b/apps/tag/web/api/v1/serializers.py @@ -161,11 +161,12 @@ class TagDistributionSerializer(serializers.ModelSerializer): """ representation = super().to_representation(instance) - representation['batch'] = { - 'id': instance.batch.id, - 'batch_creator': instance.batch.organization.name, - 'batch_identity': instance.batch.batch_identity - } + if instance.batch: + representation['batch'] = { + 'id': instance.batch.id, + 'batch_creator': instance.batch.organization.name, + 'batch_identity': instance.batch.batch_identity + } representation['assigner_org'] = { 'id': instance.assigner_org.id,