From 0855ff8b420b80356e24791c7264af18c84d0d50 Mon Sep 17 00:00:00 2001 From: jeremystretch Date: Fri, 17 Feb 2023 20:30:35 -0500 Subject: [PATCH] Skip clearing cache when handling new objects --- netbox/netbox/search/backends.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/netbox/netbox/search/backends.py b/netbox/netbox/search/backends.py index 10e164c09..14b5a987c 100644 --- a/netbox/netbox/search/backends.py +++ b/netbox/netbox/search/backends.py @@ -54,11 +54,11 @@ class SearchBackend: """ raise NotImplementedError - def caching_handler(self, sender, instance, **kwargs): + def caching_handler(self, sender, instance, created, **kwargs): """ Receiver for the post_save signal, responsible for caching object creation/changes. """ - self.cache(instance) + self.cache(instance, remove_existing=not created) def removal_handler(self, sender, instance, **kwargs): """