mirror of
https://github.com/netbox-community/netbox.git
synced 2025-12-21 04:42:22 -06:00
This commit is contained in:
@@ -2,10 +2,10 @@ from django.db import migrations, models
|
||||
|
||||
|
||||
IPADDRESS_STATUS_CHOICES = (
|
||||
(0, 'container'),
|
||||
(1, 'active'),
|
||||
(2, 'reserved'),
|
||||
(3, 'deprecated'),
|
||||
(5, 'dhcp'),
|
||||
)
|
||||
|
||||
IPADDRESS_ROLE_CHOICES = (
|
||||
|
||||
21
netbox/ipam/migrations/0034_fix_ipaddress_status_dhcp.py
Normal file
21
netbox/ipam/migrations/0034_fix_ipaddress_status_dhcp.py
Normal file
@@ -0,0 +1,21 @@
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
def ipaddress_status_dhcp_to_slug(apps, schema_editor):
|
||||
IPAddress = apps.get_model('ipam', 'IPAddress')
|
||||
IPAddress.objects.filter(status='5').update(status='dhcp')
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('ipam', '0033_deterministic_ordering'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
# Fixes a missed integer substitution from #3569; see bug #4027. The original migration has also been fixed,
|
||||
# so this can be omitted when squashing in the future.
|
||||
migrations.RunPython(
|
||||
code=ipaddress_status_dhcp_to_slug
|
||||
),
|
||||
]
|
||||
Reference in New Issue
Block a user