Przeglądaj źródła

#6732 - ASN should be unique

Daniel Sheppard 4 lat temu
rodzic
commit
96565c31d9

+ 19 - 0
netbox/ipam/migrations/0052_unique_asn.py

@@ -0,0 +1,19 @@
+# Generated by Django 3.2.8 on 2021-10-28 15:03
+
+import dcim.fields
+from django.db import migrations
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('ipam', '0051_asn_model'),
+    ]
+
+    operations = [
+        migrations.AlterField(
+            model_name='asn',
+            name='asn',
+            field=dcim.fields.ASNField(blank=True, null=True, unique=True),
+        ),
+    ]

+ 1 - 0
netbox/ipam/models/ip.py

@@ -74,6 +74,7 @@ class RIR(OrganizationalModel):
 class ASN(PrimaryModel):
 class ASN(PrimaryModel):
 
 
     asn = ASNField(
     asn = ASNField(
+        unique=True,
         blank=True,
         blank=True,
         null=True,
         null=True,
         verbose_name='ASN',
         verbose_name='ASN',