fix --> batch identity bug in create distribution from ditribute
This commit is contained in:
@@ -186,7 +186,9 @@ class TagDistributionService:
|
|||||||
parent_tag_distribution = TagDistribution.objects.get(
|
parent_tag_distribution = TagDistribution.objects.get(
|
||||||
id=dist_data['parent_tag_distribution']
|
id=dist_data['parent_tag_distribution']
|
||||||
)
|
)
|
||||||
batch = TagBatch.objects.get(batch_identity=dist_data.get('batch_identity'))
|
batch = TagBatch.objects.get(
|
||||||
|
batch_identity=dist_data.get('batch_identity')
|
||||||
|
) if dist_data.get('batch_identity') else None
|
||||||
|
|
||||||
tags = Tag.objects.filter(
|
tags = Tag.objects.filter(
|
||||||
distributions__tag_distribution_batch=parent_batch,
|
distributions__tag_distribution_batch=parent_batch,
|
||||||
@@ -221,7 +223,7 @@ class TagDistributionService:
|
|||||||
assigner_org=org,
|
assigner_org=org,
|
||||||
assigned_org=assigned_org,
|
assigned_org=assigned_org,
|
||||||
total_tag_count=total_counted_tags,
|
total_tag_count=total_counted_tags,
|
||||||
distribution_type='batch',
|
distribution_type=parent_batch.distribution_type,
|
||||||
dist_batch_identity=generate_unique_code(
|
dist_batch_identity=generate_unique_code(
|
||||||
f"{random.randint(1000, 9999)}"
|
f"{random.randint(1000, 9999)}"
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user