Skip to content

Commit bab38dc

Browse files
committed
optional param
1 parent 3320cd0 commit bab38dc

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/aap_eda/api/serializers/decision_environment.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def validate(self, data):
7373
if eda_credential_id:
7474
validators.check_if_de_valid(image_url, eda_credential_id)
7575
else:
76-
validators.check_if_de_valid(image_url, -1)
76+
validators.check_if_de_valid(image_url)
7777

7878
return data
7979

src/aap_eda/core/validators.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def check_if_de_exists(decision_environment_id: int) -> int:
6262
return decision_environment_id
6363

6464

65-
def check_if_de_valid(image_url: str, eda_credential_id: int):
65+
def check_if_de_valid(image_url: str, eda_credential_id: int = None):
6666
# The OCI standard format for the image url is a combination of a host
6767
# (with optional port) separated from the image path (with optional tag) by
6868
# a slash: <host>[:port]/<path>[:tag].
@@ -138,7 +138,7 @@ def check_if_de_valid(image_url: str, eda_credential_id: int):
138138
% {"image_url": image_url, "tag": tag}
139139
)
140140

141-
if eda_credential_id != -1:
141+
if eda_credential_id:
142142
credential = get_credential_if_exists(eda_credential_id)
143143
inputs = yaml.safe_load(credential.inputs.get_secret_value())
144144
credential_host = inputs.get("host")

0 commit comments

Comments
 (0)