mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-26 09:16:10 -06:00
12552 test fixes
This commit is contained in:
parent
ff9a9d914f
commit
a8c9d87a5c
@ -22,8 +22,8 @@ def handle_location_site_change(instance, created, **kwargs):
|
|||||||
object instead of calling update() on the QuerySet to ensure the proper change records get created for each.
|
object instead of calling update() on the QuerySet to ensure the proper change records get created for each.
|
||||||
"""
|
"""
|
||||||
if not created:
|
if not created:
|
||||||
instance.descendants().update(site=instance.site)
|
|
||||||
locations = instance.descendants(include_self=True).values_list('pk', flat=True)
|
locations = instance.descendants(include_self=True).values_list('pk', flat=True)
|
||||||
|
Location.objects.filter(pk__in=locations).update(site=instance.site)
|
||||||
Rack.objects.filter(location__in=locations).update(site=instance.site)
|
Rack.objects.filter(location__in=locations).update(site=instance.site)
|
||||||
Device.objects.filter(location__in=locations).update(site=instance.site)
|
Device.objects.filter(location__in=locations).update(site=instance.site)
|
||||||
PowerPanel.objects.filter(location__in=locations).update(site=instance.site)
|
PowerPanel.objects.filter(location__in=locations).update(site=instance.site)
|
||||||
|
@ -2,7 +2,7 @@ import django_filters
|
|||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.db import models
|
from django.db import models
|
||||||
from django.test import TestCase
|
from django.test import TestCase
|
||||||
from mptt.fields import TreeForeignKey
|
from tree_queries.fields import TreeNodeForeignKey
|
||||||
from taggit.managers import TaggableManager
|
from taggit.managers import TaggableManager
|
||||||
|
|
||||||
from dcim.choices import *
|
from dcim.choices import *
|
||||||
@ -94,7 +94,7 @@ class DummyModel(models.Model):
|
|||||||
integerfield = models.IntegerField()
|
integerfield = models.IntegerField()
|
||||||
macaddressfield = MACAddressField()
|
macaddressfield = MACAddressField()
|
||||||
timefield = models.TimeField()
|
timefield = models.TimeField()
|
||||||
treeforeignkeyfield = TreeForeignKey(
|
treeforeignkeyfield = TreeNodeForeignKey(
|
||||||
to='self',
|
to='self',
|
||||||
on_delete=models.CASCADE
|
on_delete=models.CASCADE
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user