Message when disconnecting a cable not showing ID #3149

Closed
opened 2025-12-29 18:26:07 +01:00 by adam · 4 comments
Owner

Originally created by @hSaria on GitHub (Jan 12, 2020).

Environment

  • Python version: 3.6.8
  • NetBox version: 2.6.12-dev

Steps to Reproduce

  1. Go to a device (e.g. dcim/devices/1/)
  2. Disconnect a cable

Expected Behavior

The message says Deleted cable #5 where 5 is the ID of the cable.

Observed Behavior

The message says #None

This is similar to https://github.com/netbox-community/netbox/issues/2984

Originally created by @hSaria on GitHub (Jan 12, 2020). ### Environment * Python version: 3.6.8 * NetBox version: 2.6.12-dev ### Steps to Reproduce 1. Go to a device (e.g. `dcim/devices/1/`) 2. Disconnect a cable ### Expected Behavior The message says `Deleted cable #5` where 5 is the ID of the cable. ### Observed Behavior The message says `#None` This is similar to https://github.com/netbox-community/netbox/issues/2984
adam added the type: bugstatus: accepted labels 2025-12-29 18:26:07 +01:00
adam closed this issue 2025-12-29 18:26:07 +01:00
Author
Owner

@phurrelmann commented on GitHub (Jan 12, 2020):

Maybe it would even be better to display the label if it is given. This would mimic the behaviour as shown on the device/interface view where the cable id is only displayed when the cable has no label set.

@phurrelmann commented on GitHub (Jan 12, 2020): Maybe it would even be better to display the label if it is given. This would mimic the behaviour as shown on the device/interface view where the cable id is only displayed when the cable has no label set.
Author
Owner

@hSaria commented on GitHub (Jan 12, 2020):

It already does. The issue is that self.id_string wasn't assigned prior to getting deleted. It's only the PK that gets nullified when deleted so the label is unaffected by this issue.

b7e78028ce/netbox/dcim/models.py (L3030-L3038)

@hSaria commented on GitHub (Jan 12, 2020): It already does. The issue is that `self.id_string` wasn't assigned prior to getting deleted. It's only the PK that gets nullified when deleted so the label is unaffected by this issue. https://github.com/netbox-community/netbox/blob/b7e78028ce6e998dc9172bd41bc602045daeb1ea/netbox/dcim/models.py#L3030-L3038
Author
Owner

@phurrelmann commented on GitHub (Jan 12, 2020):

perfect, then I misunderstood your comment. Sorry and thank you for your impressive work on old tickets over he last days 👍

@phurrelmann commented on GitHub (Jan 12, 2020): perfect, then I misunderstood your comment. Sorry and thank you for your impressive work on old tickets over he last days :+1:
Author
Owner

@hSaria commented on GitHub (Jan 12, 2020):

Nothing to be sorry for. In fact, I appreciate you looking out, so thanks for that and keep it coming. And I'm just giving back some love to this project that clearly deserves it.

@hSaria commented on GitHub (Jan 12, 2020): Nothing to be sorry for. In fact, I appreciate you looking out, so thanks for that and keep it coming. And I'm just giving back some love to this project that clearly deserves it.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#3149