Fixed issue registering activity on shotless task
This commit is contained in:
@@ -93,16 +93,18 @@ def _parent_name(task):
|
||||
|
||||
def register_task_activity(task, descr):
|
||||
user_id = pillar.api.utils.authentication.current_user_id()
|
||||
if not user_id:
|
||||
log.error('Unable to register task activity %r for task %s: user_id=%s',
|
||||
descr, task['_id'], user_id)
|
||||
return
|
||||
|
||||
context_ob = task.get('parent')
|
||||
context_type = 'node'
|
||||
if not context_ob:
|
||||
context_type = 'project'
|
||||
context_ob = task['project']
|
||||
|
||||
pillar.api.activities.register_activity(
|
||||
user_id,
|
||||
descr + _parent_name(task),
|
||||
'node', task['_id'],
|
||||
'node', task.get('parent'),
|
||||
context_type, context_ob,
|
||||
task['project'],
|
||||
node_type=task['node_type'],
|
||||
)
|
||||
|
Reference in New Issue
Block a user