Use the literal 'System' instead of the target name when

the action user in unknown.

Signed-off-by: Roberto Rosario <roberto.rosario.gonzalez@gmail.com>
This commit is contained in:
Roberto Rosario
2017-08-24 03:54:51 -04:00
parent f62406810d
commit b26f0b08fb

View File

@@ -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'])