diff --git a/src/aap_eda/api/serializers/decision_environment.py b/src/aap_eda/api/serializers/decision_environment.py index 445556388..cdd653197 100644 --- a/src/aap_eda/api/serializers/decision_environment.py +++ b/src/aap_eda/api/serializers/decision_environment.py @@ -12,8 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -from urllib.parse import urlparse - from rest_framework import serializers from aap_eda.api.serializers.eda_credential import EdaCredentialRefSerializer diff --git a/src/aap_eda/core/validators.py b/src/aap_eda/core/validators.py index f63fddea2..f603d6b85 100644 --- a/src/aap_eda/core/validators.py +++ b/src/aap_eda/core/validators.py @@ -133,7 +133,6 @@ def check_if_de_valid(image_url: str, eda_credential_id: int): ) if eda_credential_id != -1: - credential = get_credential_if_exists(eda_credential_id) inputs = yaml.safe_load(credential.inputs.get_secret_value()) credential_host = inputs.get("host") @@ -145,8 +144,9 @@ def check_if_de_valid(image_url: str, eda_credential_id: int): ) # Check that the host matches the credential host. - # For backward compatibility when creating a new DE with an old credential - # we need to separate any scheme from the host before doing the compare. + # For backward compatibility when creating a new DE with + # an old credential we need to separate any + # scheme from the host before doing the compare. parsed_credential_host = urllib.parse.urlparse(credential_host) # If there's a netloc that's the host to use; if not, it's the path if # there is no scheme else it's the scheme and path joined by a colon.