Skip to content

Commit ce36728

Browse files
authored
fix: getting permissions of create template version (HEXA-1228)(#249)
1 parent 1fd0991 commit ce36728

3 files changed

Lines changed: 6 additions & 4 deletions

File tree

openhexa/cli/api.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -570,7 +570,9 @@ def upload_pipeline(
570570
pipeline {
571571
id
572572
permissions {
573-
createTemplateVersion
573+
createTemplateVersion {
574+
isAllowed
575+
}
574576
}
575577
template {
576578
id

openhexa/cli/cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ def pipelines_init(name: str):
230230
def propose_to_create_template_version(workspace, pipeline_version, yes):
231231
"""Propose to create a new version of the template if the pipeline is based on a template."""
232232
pipeline = pipeline_version["pipeline"]
233-
if pipeline["template"] and pipeline["permissions"]["createTemplateVersion"]:
233+
if pipeline["template"] and pipeline["permissions"]["createTemplateVersion"]["isAllowed"]:
234234
if not yes and not click.confirm(
235235
f"The template {click.style(pipeline['template']['name'], bold=True)} is based on this pipeline, do you want to publish a new version of the template as well?",
236236
True,

tests/test_cli.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ def test_push_pipeline(
153153
"versionName": version,
154154
"pipeline": {
155155
"id": pipeline_id,
156-
"permissions": {"createTemplateVersion": True},
156+
"permissions": {"createTemplateVersion": {"isAllowed": True}},
157157
"template": template,
158158
},
159159
"id": pipeline_version_id,
@@ -269,7 +269,7 @@ def test_push_pipeline_with_code_flag(
269269
"versionName": version,
270270
"pipeline": {
271271
"id": pipeline_id,
272-
"permissions": {"createTemplateVersion": True},
272+
"permissions": {"createTemplateVersion": {"isAllowed": True}},
273273
"template": template,
274274
},
275275
"id": pipeline_version_id,

0 commit comments

Comments
 (0)