Skip to content

Commit

Permalink
Merge pull request #807 from alliance-genome/SCRUM-4659
Browse files Browse the repository at this point in the history
adding a new field 'updated_by_email' to WFT show endpoint
  • Loading branch information
sweng66 authored Dec 16, 2024
2 parents 1fb8043 + c6efcdb commit 71ddc66
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
10 changes: 10 additions & 0 deletions agr_literature_service/api/crud/workflow_tag_crud.py
Original file line number Diff line number Diff line change
Expand Up @@ -545,6 +545,16 @@ def show(db: Session, reference_workflow_tag_id: int):
else:
workflow_tag_data["mod_abbreviation"] = ""
del workflow_tag_data["mod_id"]
## add email address for updated_by
sql_query_str = """
SELECT email
FROM users
WHERE id = :okta_id
"""
sql_query = text(sql_query_str)
result = db.execute(sql_query, {'okta_id': workflow_tag_data["updated_by"]})
row = result.fetchone()
workflow_tag_data["updated_by_email"] = workflow_tag_data["updated_by"] if row is None else row[0]

return workflow_tag_data

Expand Down
1 change: 1 addition & 0 deletions agr_literature_service/api/schemas/workflow_tag_schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class WorkflowTagSchemaRelated(AuditedObjectModelSchema):
reference_workflow_tag_id: Optional[int]
workflow_tag_id: str
mod_abbreviation: Optional[str]
updated_by_email: Optional[str]


# used by workflow_tag_crud
Expand Down

0 comments on commit 71ddc66

Please sign in to comment.