From 8c309e9a4100a17934e670fa55cb2b878e2c6e5d Mon Sep 17 00:00:00 2001 From: Kelly McDonald Date: Thu, 18 Feb 2021 08:44:44 -0500 Subject: [PATCH] Add user display name to the response for task events --- crc/models/task_event.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crc/models/task_event.py b/crc/models/task_event.py index aa05a4f7..21a239ee 100644 --- a/crc/models/task_event.py +++ b/crc/models/task_event.py @@ -4,6 +4,7 @@ from marshmallow_sqlalchemy import SQLAlchemyAutoSchema from crc import db, ma from crc.models.study import StudyModel, StudySchema, WorkflowMetadataSchema, WorkflowMetadata from crc.models.workflow import WorkflowModel +from crc.services.ldap_service import LdapService class TaskEventModel(db.Model): @@ -43,6 +44,7 @@ class TaskEvent(object): self.study = study self.workflow = workflow self.user_uid = model.user_uid + self.user_display = LdapService.user_info(model.user_uid).display_name self.action = model.action self.task_id = model.task_id self.task_title = model.task_title @@ -60,6 +62,6 @@ class TaskEventSchema(ma.Schema): task_lane = fields.String(allow_none=True, required=False) class Meta: model = TaskEvent - additional = ["id", "user_uid", "action", "task_id", "task_title", + additional = ["id", "user_uid", "user_display", "action", "task_id", "task_title", "task_name", "task_type", "task_state", "task_lane", "date"] unknown = INCLUDE