mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-13 16:47:34 -06:00
Update wireless link to support catching the "pretty" error.
This commit is contained in:
parent
e11ee36f7a
commit
f7296baa58
@ -3,8 +3,10 @@ import logging
|
||||
from django.db.models.signals import post_save, post_delete
|
||||
from django.dispatch import receiver
|
||||
|
||||
from dcim.exceptions import UnsupportedCablePath
|
||||
from dcim.models import CablePath, Interface
|
||||
from dcim.utils import create_cablepath
|
||||
from utilities.exceptions import AbortRequest
|
||||
from .models import WirelessLink
|
||||
|
||||
|
||||
@ -34,7 +36,10 @@ def update_connected_interfaces(instance, created, raw=False, **kwargs):
|
||||
# Create/update cable paths
|
||||
if created:
|
||||
for interface in (instance.interface_a, instance.interface_b):
|
||||
create_cablepath([interface])
|
||||
try:
|
||||
create_cablepath([interface])
|
||||
except UnsupportedCablePath as e:
|
||||
raise AbortRequest(e)
|
||||
|
||||
|
||||
@receiver(post_delete, sender=WirelessLink)
|
||||
|
Loading…
Reference in New Issue
Block a user