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:
@@ -12,6 +12,10 @@ from .licenses import * # NOQA
|
|||||||
from .widgets import event_type_link
|
from .widgets import event_type_link
|
||||||
|
|
||||||
|
|
||||||
|
def event_actor(action):
|
||||||
|
return _('System') if action.actor == action.target else action.actor
|
||||||
|
|
||||||
|
|
||||||
class EventsApp(MayanAppConfig):
|
class EventsApp(MayanAppConfig):
|
||||||
has_tests = True
|
has_tests = True
|
||||||
name = 'events'
|
name = 'events'
|
||||||
@@ -26,7 +30,10 @@ class EventsApp(MayanAppConfig):
|
|||||||
SourceColumn(
|
SourceColumn(
|
||||||
source=Action, label=_('Timestamp'), attribute='timestamp'
|
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(
|
SourceColumn(
|
||||||
source=Action, label=_('Verb'),
|
source=Action, label=_('Verb'),
|
||||||
func=lambda context: event_type_link(context['object'])
|
func=lambda context: event_type_link(context['object'])
|
||||||
|
|||||||
Reference in New Issue
Block a user