diff --git a/src/carbon_calculator/CCDefaults.py b/src/carbon_calculator/CCDefaults.py index 02f2fd212..d75fa733c 100644 --- a/src/carbon_calculator/CCDefaults.py +++ b/src/carbon_calculator/CCDefaults.py @@ -91,7 +91,8 @@ def getDefault(self, locality, variable, date, default=None): value = var["values"][-1] else: for i in range(len(var["valid_dates"])): - valid_date = var["valid_dates"][i] + valid_date = datetime.strptime(var["valid_dates"][i], '%Y-%m-%d').date() + print(locality,variable,valid_date,type(valid_date)) if valid_date < date: value = var["values"][i] return value diff --git a/src/task_queue/database_tasks/update_actions_content.py b/src/task_queue/database_tasks/update_actions_content.py index b1a866380..9878f44cd 100644 --- a/src/task_queue/database_tasks/update_actions_content.py +++ b/src/task_queue/database_tasks/update_actions_content.py @@ -119,7 +119,7 @@ def update_actions_content(task=None): if len(data) > 0: report = write_to_csv(data) temp_data = {'data_type': "Content Spacing", "name":task.creator.full_name if task.creator else "admin"} - file_name = "Content-Spacing-Report-{}.csv".format(datetime.datetime.now().strftime("%Y-%m-%d")) + file_name = "Update-Actions-Report-{}.csv".format(datetime.datetime.now().strftime("%Y-%m-%d")) send_massenergize_email_with_attachments(DATA_DOWNLOAD_TEMPLATE,temp_data,[task.creator.email], report, file_name) return True