Skip to content

feat/DEVSU-2616 create project when submitting a report with report_async #59

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions pori_python/ipr/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,14 @@ def upload_report(
# if async is used, the response for reports-async contains either 'jobStatus'
# or 'report'. jobStatus is no longer available once the report is successfully
# uploaded.

projects = self.get("project")
project_names = [item['name'] for item in projects]

# if project is not exist, create one
if content['project'] not in project_names:
self.post("project", {'name': content['project']})

initial_result = self.post("reports-async", content)

report_id = initial_result["ident"]
Expand Down