Only set the actor when it was not set explicitly

This commit is contained in:
Jan-Jelle Kester 2013-10-23 17:20:21 +02:00
parent 6dd93496b6
commit b66ada0baa

View file

@ -24,5 +24,5 @@ class AuditLogMiddleware(object):
return response
def set_actor(self, user, sender, instance, **kwargs):
if sender == LogEntry and isinstance(user, settings.AUTH_USER_MODEL):
if sender == LogEntry and isinstance(user, settings.AUTH_USER_MODEL) and instance.actor is None:
instance.actor = user