fix --> non batch in tag distribution
This commit is contained in:
@@ -161,11 +161,12 @@ class TagDistributionSerializer(serializers.ModelSerializer):
|
|||||||
"""
|
"""
|
||||||
representation = super().to_representation(instance)
|
representation = super().to_representation(instance)
|
||||||
|
|
||||||
representation['batch'] = {
|
if instance.batch:
|
||||||
'id': instance.batch.id,
|
representation['batch'] = {
|
||||||
'batch_creator': instance.batch.organization.name,
|
'id': instance.batch.id,
|
||||||
'batch_identity': instance.batch.batch_identity
|
'batch_creator': instance.batch.organization.name,
|
||||||
}
|
'batch_identity': instance.batch.batch_identity
|
||||||
|
}
|
||||||
|
|
||||||
representation['assigner_org'] = {
|
representation['assigner_org'] = {
|
||||||
'id': instance.assigner_org.id,
|
'id': instance.assigner_org.id,
|
||||||
|
|||||||
Reference in New Issue
Block a user