Browse Source

Fixes #1869: Corrected ordering of VRFs with duplicate names

Jeremy Stretch 7 years ago
parent
commit
c8309581be
2 changed files with 20 additions and 1 deletions
  1. 19 0
      netbox/ipam/migrations/0021_vrf_ordering.py
  2. 1 1
      netbox/ipam/models.py

+ 19 - 0
netbox/ipam/migrations/0021_vrf_ordering.py

@@ -0,0 +1,19 @@
+# -*- coding: utf-8 -*-
+# Generated by Django 1.11.9 on 2018-02-07 18:37
+from __future__ import unicode_literals
+
+from django.db import migrations
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('ipam', '0020_ipaddress_add_role_carp'),
+    ]
+
+    operations = [
+        migrations.AlterModelOptions(
+            name='vrf',
+            options={'ordering': ['name', 'rd'], 'verbose_name': 'VRF', 'verbose_name_plural': 'VRFs'},
+        ),
+    ]

+ 1 - 1
netbox/ipam/models.py

@@ -37,7 +37,7 @@ class VRF(CreatedUpdatedModel, CustomFieldModel):
     csv_headers = ['name', 'rd', 'tenant', 'enforce_unique', 'description']
 
     class Meta:
-        ordering = ['name']
+        ordering = ['name', 'rd']
         verbose_name = 'VRF'
         verbose_name_plural = 'VRFs'