From 96480ae588ae4840f48f4476a3d9a29f2c3631e0 Mon Sep 17 00:00:00 2001 From: Charlie Jacomme Date: Tue, 7 Aug 2018 11:19:45 +0200 Subject: [PATCH] mx not uniques, same mx for several extensions --- .../migrations/0093_auto_20180807_1115.py | 26 +++++++++++++++++++ machines/models.py | 4 +-- 2 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 machines/migrations/0093_auto_20180807_1115.py diff --git a/machines/migrations/0093_auto_20180807_1115.py b/machines/migrations/0093_auto_20180807_1115.py new file mode 100644 index 00000000..866cb87d --- /dev/null +++ b/machines/migrations/0093_auto_20180807_1115.py @@ -0,0 +1,26 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.10.7 on 2018-08-07 09:15 +from __future__ import unicode_literals + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('machines', '0092_auto_20180807_0926'), + ] + + operations = [ + migrations.AlterField( + model_name='mx', + name='name', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='machines.Domain'), + ), + migrations.AlterField( + model_name='mx', + name='priority', + field=models.PositiveIntegerField(), + ), + ] diff --git a/machines/models.py b/machines/models.py index b9fd9205..f109b217 100644 --- a/machines/models.py +++ b/machines/models.py @@ -740,8 +740,8 @@ class Mx(RevMixin, AclMixin, models.Model): PRETTY_NAME = "Enregistrements MX" zone = models.ForeignKey('Extension', on_delete=models.PROTECT) - priority = models.PositiveIntegerField(unique=True) - name = models.OneToOneField('Domain', on_delete=models.PROTECT) + priority = models.PositiveIntegerField() + name = models.ForeignKey('Domain', on_delete=models.PROTECT) class Meta: permissions = (