From ad4aae78f2f88a9aa93c7243d7f56a62994d034d Mon Sep 17 00:00:00 2001 From: LeandroJatai Date: Fri, 5 Aug 2022 12:38:37 -0300 Subject: [PATCH] add unique_together a VinculoDocAdminMateria --- sapl/protocoloadm/models.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sapl/protocoloadm/models.py b/sapl/protocoloadm/models.py index 3d532a2d0..c35c4e828 100644 --- a/sapl/protocoloadm/models.py +++ b/sapl/protocoloadm/models.py @@ -472,6 +472,9 @@ class VinculoDocAdminMateria(models.Model): verbose_name_plural = _( 'Vinculos entre Documento Administrativo e Matéria Legislativa') ordering = ('id',) + unique_together = ( + ('documento', 'materia'), + ) def __str__(self): return f'Vinculo: {self.documento} - {self.materia}'