Skip to content

Commit

Permalink
add ticket_url to extra_data
Browse files Browse the repository at this point in the history
  • Loading branch information
MJedr committed Oct 25, 2023
1 parent 5d3f79c commit 7bfb614
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/backend-tests-on-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ jobs:
--ignore tests/integration/workflows/test_workflows_tasks_upload.py \
--ignore tests/integration/workflows/test_arxiv_workflow.py \
--ignore tests/integration/workflows/test_edit_article.py \
--ignore tests/integration/workflows/test_views.py
--ignore tests/integration/workflows/test_views.py \
--ignore tests/integration/workflows/test_workflow_tasks_submission
Workflows-II:
runs-on: ubuntu-latest
Expand Down
4 changes: 3 additions & 1 deletion inspirehep/modules/workflows/tasks/submission.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,11 @@ def submit_snow_ticket(obj, queue, template, context, caller, recid, ticket_id_k
data=json.dumps(ticket_payload),
)
response.raise_for_status()
ticket_id = response.json()["ticket_id"]
response_json = response.json()
ticket_id = response_json["ticket_id"]

obj.extra_data[ticket_id_key] = ticket_id
obj.extra_data["ticket_url"] = response_json["ticket_url"]
obj.log.info("Ticket {0} created".format(ticket_id))
return ticket_id

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def test_create_ticket_calls_tickets_create_with_template(workflow_app):
request_mocker.register_uri(
"POST",
"http://web:8000/tickets/create-with-template",
json={"ticket_id": "123"},
json={"ticket_id": "123", "ticket_url": "http//test.com/1"},
headers=_get_headers_for_hep_root_table_request(),
status_code=200,
)
Expand Down

0 comments on commit 7bfb614

Please sign in to comment.