mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-26 01:06:11 -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.
|
||||
"""
|
||||
if not created:
|
||||
instance.descendants().update(site=instance.site)
|
||||
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)
|
||||
Device.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.db import models
|
||||
from django.test import TestCase
|
||||
from mptt.fields import TreeForeignKey
|
||||
from tree_queries.fields import TreeNodeForeignKey
|
||||
from taggit.managers import TaggableManager
|
||||
|
||||
from dcim.choices import *
|
||||
@ -94,7 +94,7 @@ class DummyModel(models.Model):
|
||||
integerfield = models.IntegerField()
|
||||
macaddressfield = MACAddressField()
|
||||
timefield = models.TimeField()
|
||||
treeforeignkeyfield = TreeForeignKey(
|
||||
treeforeignkeyfield = TreeNodeForeignKey(
|
||||
to='self',
|
||||
on_delete=models.CASCADE
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user