From f4e564b75b5e22fed5a34d9fc5d175881568fce4 Mon Sep 17 00:00:00 2001 From: Ryan J Field Date: Fri, 7 Jul 2023 10:07:24 +0100 Subject: [PATCH] fix bug --- data_pipeline_api/fdp_utils.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/data_pipeline_api/fdp_utils.py b/data_pipeline_api/fdp_utils.py index dd9d63b..41680c4 100644 --- a/data_pipeline_api/fdp_utils.py +++ b/data_pipeline_api/fdp_utils.py @@ -238,8 +238,9 @@ def post_file_type( """ Internal wrapper function to return check if a file_type already exists and return it. """ - if "extension" not in data and data["extension"]: - raise ValueError("error file_type name not specified") + if "extension" not in data: + if not data["extension"]: + raise ValueError("error file_type name not specified") file_type_exists = get_entry(url= url, endpoint= "file_type", query= {"extension": data["extension"]},