agendas: add unique_together meta to VirtualMember (#42413)
This commit is contained in:
parent
4d5d9a7c3c
commit
d28c18add0
|
@ -0,0 +1,16 @@
|
|||
# Generated by Django 2.2.12 on 2020-05-03 12:31
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('agendas', '0041_clean_event_slug_unicity'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterUniqueTogether(
|
||||
name='virtualmember', unique_together={('virtual_agenda', 'real_agenda')},
|
||||
),
|
||||
]
|
|
@ -289,6 +289,9 @@ class VirtualMember(models.Model):
|
|||
Agenda, on_delete=models.CASCADE, related_name='virtual_members', verbose_name='Agenda'
|
||||
)
|
||||
|
||||
class Meta:
|
||||
unique_together = (('virtual_agenda', 'real_agenda'),)
|
||||
|
||||
def clean(self):
|
||||
error_msg = [_('This agenda does not have the same meeting types provided by the virtual agenda.')]
|
||||
error = False
|
||||
|
|
Loading…
Reference in New Issue