mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-23 07:56:44 -06:00
14042 fix cache count for mptt child delete
This commit is contained in:
parent
14447befb9
commit
8fc41f9aaf
@ -72,7 +72,10 @@ def post_delete_receiver(sender, instance, **kwargs):
|
||||
|
||||
# Decrement the parent's counter by one
|
||||
if parent_pk is not None:
|
||||
update_counter(parent_model, parent_pk, counter_name, -1)
|
||||
# MPTT sends two delete signals if child element so guard against multiple decrements
|
||||
origin = kwargs.get('origin')
|
||||
if not origin or origin == instance:
|
||||
update_counter(parent_model, parent_pk, counter_name, -1)
|
||||
|
||||
|
||||
#
|
||||
|
Loading…
Reference in New Issue
Block a user