From d2d0fd80a366f0bc7e754d7c7303e5b560882909 Mon Sep 17 00:00:00 2001 From: pilot <657434@03b.ru> Date: Mon, 10 Aug 2026 14:29:10 +0800 Subject: [PATCH] =?UTF-8?q?=D0=A1=D0=BE=D0=B3=D0=BB=D0=B0=D1=81=D0=B5?= =?UTF-8?q?=D0=BD=20=D0=BD=D0=B0=20=D0=BE=D0=B1=D1=80=D0=B0=D0=B1=D0=BE?= =?UTF-8?q?=D1=82=D0=BA=D1=83=20=D0=BF=D0=B5=D1=80=D1=81=D0=BE=D0=BD=D0=B0?= =?UTF-8?q?=D0=BB=D1=8C=D0=BD=D1=8B=D1=85=20=D0=B4=D0=B0=D0=BD=D0=BD=D1=8B?= =?UTF-8?q?=D1=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- restoran_max_bot/max_bot/models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/restoran_max_bot/max_bot/models.py b/restoran_max_bot/max_bot/models.py index c172db3..6b79f04 100644 --- a/restoran_max_bot/max_bot/models.py +++ b/restoran_max_bot/max_bot/models.py @@ -644,9 +644,8 @@ class Qr(models.Model): class PromoCode(models.Model): - objects = None client = models.ForeignKey(Client, on_delete=models.CASCADE) - promo = models.CharField(max_length=50, unique=True) + promo = models.CharField(max_length=50) # без unique=True chat_id = models.CharField(max_length=50) messenger = models.CharField(max_length=20, default='max') used = models.BooleanField(default=False) @@ -655,3 +654,4 @@ class PromoCode(models.Model): class Meta: db_table = 'lk_promo_code' + unique_together = ('promo', 'chat_id', 'client') # составной уникальный ключ