mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-21 11:37:21 -06:00
Disconnect post_save & pre_delete signals after the response has been received
This commit is contained in:
parent
909971f237
commit
36f8d6d259
@ -101,6 +101,10 @@ class ObjectChangeMiddleware(object):
|
|||||||
if not _thread_locals.changed_objects:
|
if not _thread_locals.changed_objects:
|
||||||
return response
|
return response
|
||||||
|
|
||||||
|
# Disconnect our receivers from the post_save and post_delete signals.
|
||||||
|
post_save.disconnect(handle_changed_object, dispatch_uid='handle_changed_object')
|
||||||
|
pre_delete.disconnect(handle_deleted_object, dispatch_uid='handle_deleted_object')
|
||||||
|
|
||||||
# Create records for any cached objects that were changed.
|
# Create records for any cached objects that were changed.
|
||||||
redis_failed = False
|
redis_failed = False
|
||||||
for instance, action in _thread_locals.changed_objects:
|
for instance, action in _thread_locals.changed_objects:
|
||||||
|
Loading…
Reference in New Issue
Block a user