customizations icon indicating copy to clipboard operation
customizations copied to clipboard

add_device_type_components.py: update the cached component counts on the Device

Open candlerb opened this issue 1 year ago • 5 comments

See discussion https://github.com/netbox-community/netbox/discussions/14975

candlerb avatar Jan 30 '24 12:01 candlerb

Another approach would be to avoid bulk_create and instead do:

                    for i in items:
                        i.full_clean()
                        i.save()

candlerb avatar Feb 12 '24 13:02 candlerb

Hey,

I tested this fix, and the original commit did not actually resolve the issue for me - same behavior as the current file. Your alternative with save() did work though. This is on netbox v3.7.4.

Pythbit avatar Mar 14 '24 23:03 Pythbit

OK, I've changed it to the simpler (but perhaps slightly slower) approach.

candlerb avatar Mar 15 '24 07:03 candlerb

my team tested this change manually, and it worked perfectly.

ip-rx avatar Mar 28 '24 14:03 ip-rx

@candlerb what are your thoughts on: https://github.com/netbox-community/customizations/issues/100#issuecomment-2025921835

ip-rx avatar Mar 28 '24 19:03 ip-rx