From 50d4b5c7513cf03a9fb408d8ec3f342a0a6e3f2a Mon Sep 17 00:00:00 2001 From: Shivam Date: Fri, 3 Nov 2023 12:59:32 +0530 Subject: [PATCH] G2P-1348: Ensured name field uniqueness in Payment File Configs --- g2p_payment_files/models/payment_manager.py | 4 ---- g2p_programs/models/payment.py | 4 ++++ 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/g2p_payment_files/models/payment_manager.py b/g2p_payment_files/models/payment_manager.py index 00ca0ad8..560a6051 100644 --- a/g2p_payment_files/models/payment_manager.py +++ b/g2p_payment_files/models/payment_manager.py @@ -131,7 +131,3 @@ class G2PPaymentBatchTag(models.Model): ) file_config_ids = fields.Many2many("g2p.payment.file.config") - - _sql_constraints = [ - ("name_unique", "unique(name)", "The name must be unique!!"), - ] diff --git a/g2p_programs/models/payment.py b/g2p_programs/models/payment.py index 8b8d9b53..1b4c4c9a 100644 --- a/g2p_programs/models/payment.py +++ b/g2p_programs/models/payment.py @@ -178,3 +178,7 @@ class G2PPaymentBatchTag(models.Model): domain = fields.Text(default="[]") max_batch_size = fields.Integer(default=500) + + _sql_constraints = [ + ("name_unique", "unique(name)", "The name must be unique!!"), + ]