diff --git a/cove_bods/process.py b/cove_bods/process.py index d6eedf6..c641895 100644 --- a/cove_bods/process.py +++ b/cove_bods/process.py @@ -31,16 +31,16 @@ logger = getLogger(__name__) -def check_table_file_new(filename): +def check_table_file_new(input_file): logger.info(f"{filename} {type(filename)}") - if get_file_type_for_flatten_tool(filename) == "xlsx": - data = pandas.read_excel(filename) + if get_file_type_for_flatten_tool(input_file) == "xlsx": + data = pandas.read_excel(input_file.upload_dir_and_filename()) if "statementID" in data.head(): return False else: return True else: - with open(filename) as file: + with open(input_file.upload_dir_and_filename()) as file: head = file.readline() if "statementID" in data.head(): return False @@ -202,7 +202,7 @@ def process(self, process_data: dict) -> dict: # We don't know what schema version the spreadsheet is in. Use default schema. schema = SchemaBODS() - if check_table_file_new(input_filename): + if check_table_file_new(supplied_data_json_file): statement_id_name = "statementID" else: statement_id_name = "statementId"