From b26f0b08fb5136924d06800a0eee55cb708d642b Mon Sep 17 00:00:00 2001 From: Roberto Rosario Date: Thu, 24 Aug 2017 03:54:51 -0400 Subject: [PATCH] Use the literal 'System' instead of the target name when the action user in unknown. Signed-off-by: Roberto Rosario --- mayan/apps/events/apps.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/mayan/apps/events/apps.py b/mayan/apps/events/apps.py index b866d0d459..abbce94d7d 100644 --- a/mayan/apps/events/apps.py +++ b/mayan/apps/events/apps.py @@ -12,6 +12,10 @@ from .licenses import * # NOQA from .widgets import event_type_link +def event_actor(action): + return _('System') if action.actor == action.target else action.actor + + class EventsApp(MayanAppConfig): has_tests = True name = 'events' @@ -26,7 +30,10 @@ class EventsApp(MayanAppConfig): SourceColumn( source=Action, label=_('Timestamp'), attribute='timestamp' ) - SourceColumn(source=Action, label=_('Actor'), attribute='actor') + SourceColumn( + source=Action, label=_('Actor'), + func=lambda context: event_actor(context['object']) + ) SourceColumn( source=Action, label=_('Verb'), func=lambda context: event_type_link(context['object'])