@staticmethod
    def set_actor(user, sender, instance, **kwargs):
        """
        Signal receiver with an extra, required 'user' kwarg. This method becomes a real (valid) signal receiver when
        it is curried with the actor.
        """
        try:
            app_label, model_name = settings.AUTH_USER_MODEL.split('.')
            auth_user_model = apps.get_model(app_label, model_name)
        except __HOLE__:
            auth_user_model = apps.get_model('auth', 'user')
        if sender == LogEntry and isinstance(user, auth_user_model) and instance.actor is None:
            instance.actor = user
        if hasattr(threadlocal, 'auditlog'):
            instance.remote_addr = threadlocal.auditlog['remote_addr']
dataset/ETHPy150Open jjkester/django-auditlog/src/auditlog/middleware.py/AuditlogMiddleware.set_actor