diff --git a/netbox/utilities/counters.py b/netbox/utilities/counters.py index 6b5adffad..6c1418dff 100644 --- a/netbox/utilities/counters.py +++ b/netbox/utilities/counters.py @@ -39,9 +39,8 @@ def post_save_receiver(sender, instance, created, **kwargs): # Update the counters on the old and/or new parents as needed if old_pk is not None: update_counter(parent_model, old_pk, counter_name, -1) - if new_pk is not None: - if old_pk or created: - update_counter(parent_model, new_pk, counter_name, 1) + if new_pk is not None and (old_pk or created): + update_counter(parent_model, new_pk, counter_name, 1) def post_delete_receiver(sender, instance, **kwargs):