diff --git a/sumstats_service/app.py b/sumstats_service/app.py index 74e581a..53d5af4 100644 --- a/sumstats_service/app.py +++ b/sumstats_service/app.py @@ -115,7 +115,10 @@ def sumstats(): # option to bypass all validation and downstream steps bypass = au.val_from_dict(key="skipValidation", dict=content, default=False) - file_type = au.determine_file_type(is_in_file=True, is_bypass=bypass) + file_type = au.determine_file_type( + is_in_file=True, + is_force_valid=bool(force_valid), + ) logger.info(f"{minrows=} {force_valid=} {bypass=} {file_type=}") @@ -156,7 +159,10 @@ def validate_sumstats(callback_id: str): # determine file_type template = au.get_template(callback_id) - file_type = au.determine_file_type(is_in_file=bool(template), is_bypass=bypass) + file_type = au.determine_file_type( + is_in_file=bool(template), + is_force_valid=bool(force_valid), + ) validate_files_in_background.apply_async( kwargs={ diff --git a/sumstats_service/resources/api_utils.py b/sumstats_service/resources/api_utils.py index 990f1c7..20d1c29 100644 --- a/sumstats_service/resources/api_utils.py +++ b/sumstats_service/resources/api_utils.py @@ -348,10 +348,12 @@ def move_files_to_staging(study_list): } -def determine_file_type(is_in_file, is_bypass) -> str: - if is_bypass: - return "Non-GWAS-SSF" - return config.SUMSTATS_FILE_TYPE + ("-incomplete-meta" if not is_in_file else "") +def determine_file_type(is_in_file, is_force_valid) -> str: + return ( + "Non-GWAS-SSF" + if is_force_valid + else config.SUMSTATS_FILE_TYPE + ("-incomplete-meta" if not is_in_file else "") + ) def get_template(callback_id):