From 96a3be9f3c7154a1e898f6b1582132b5400f43db Mon Sep 17 00:00:00 2001 From: behruz-dev Date: Thu, 30 Oct 2025 19:49:13 +0500 Subject: [PATCH] fix --- core/apps/products/management/commands/import_units.py | 1 - core/apps/products/models/unity.py | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/core/apps/products/management/commands/import_units.py b/core/apps/products/management/commands/import_units.py index 23855fc..efc2335 100644 --- a/core/apps/products/management/commands/import_units.py +++ b/core/apps/products/management/commands/import_units.py @@ -18,5 +18,4 @@ class Command(BaseCommand): Unity.objects.get_or_create( value=item['name']['uz'] ) - self.stdout.write("Units added") \ No newline at end of file diff --git a/core/apps/products/models/unity.py b/core/apps/products/models/unity.py index 7ac63c1..78013da 100644 --- a/core/apps/products/models/unity.py +++ b/core/apps/products/models/unity.py @@ -5,7 +5,7 @@ from core.apps.shared.models import BaseModel class Unity(BaseModel): - value = models.CharField(max_length=50) + value = models.CharField(max_length=50, unique=True) def __str__(self): return self.value