code: def process_exception(self, request, exception):
          
          if hasattr(threadlocal, 'auditlog'):
              pre_save.disconnect(sender=LogEntry, dispatch_uid=threadlocal.auditlog['signal_duid'])
  
          return None
docs: Disconnects the signal receiver to prevent it from staying active in case of an exception.