Skip to content

Commit

Permalink
reply snow ticket: add user email to request payload
Browse files Browse the repository at this point in the history
  • Loading branch information
MJedr committed Oct 19, 2023
1 parent b31ff62 commit 617df54
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
7 changes: 6 additions & 1 deletion inspirehep/modules/workflows/tasks/submission.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,11 @@ def reply_snow_ticket(obj, ticket_id, context_factory, user, template=None):
),
headers=_get_headers_for_hep_root_table_request(),
data=json.dumps(
{"ticket_id": str(ticket_id), "reply_message": reply_message}
{
"ticket_id": str(ticket_id),
"reply_message": reply_message,
"user_email": user.email
}
),
)
response.raise_for_status()
Expand All @@ -178,6 +182,7 @@ def reply_snow_ticket(obj, ticket_id, context_factory, user, template=None):
"ticket_id": str(ticket_id),
"template": template,
"template_context": template_context,
"user_email": user.email
}
),
)
Expand Down
4 changes: 2 additions & 2 deletions tests/integration/workflows/test_workflow_tasks_submission.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def test_reply_ticket_calls_tickets_reply_when_template_is_not_set(workflow_app)
assert expected_result == result
assert (
request_mocker.request_history[0]._request.body
== '{"ticket_id": "1", "reply_message": "reply reason"}'
== '{"ticket_id": "1", "user_email": "[email protected]", "reply_message": "reply reason"}'
)


Expand Down Expand Up @@ -68,7 +68,7 @@ def test_reply_ticket_calls_tickets_reply_when_template_is_set(workflow_app):
assert expected_result == result
assert (
request_mocker.request_history[0]._request.body
== '{"template_context": {"reason": "", "record_url": "", "user_name": "[email protected]", "title": "Partial Symmetries of Weak Interactions"}, "ticket_id": "1", "template": "test"}'
== '{"user_email": "[email protected]", "template_context": {"reason": "", "record_url": "", "user_name": "[email protected]", "title": "Partial Symmetries of Weak Interactions"}, "ticket_id": "1", "template": "test"}'
)


Expand Down

0 comments on commit 617df54

Please sign in to comment.