Skip to content

Commit

Permalink
Version 4.12.22
Browse files Browse the repository at this point in the history
minor bug fixes
  • Loading branch information
BradHN1 committed Oct 23, 2023
1 parent 3f02685 commit 60db4d9
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/_main_/config/build/deployConfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"IS_PROD": false,
"IS_CANARY": false,
"BUILD_VERSION": "4.12.21",
"BUILD_VERSION": "4.12.22",
"BUILD_VERSION_NOTES": "Feb 24: Admin portal pagination:\n- deliver content in small chunks"
}
6 changes: 2 additions & 4 deletions src/api/store/download.py
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ def _get_user_actions_cells(self, user, actions, teams):
}
return self._get_cells_from_dict(self.user_info_columns_new, user_cells)

# Recieves an action, returns how many times it's been marked as Done in the last 30 days
# Receives an action, returns how many times it's been marked as Done in the last 30 days
def _get_last_30_days_count(self, action):
today = datetime.date.today()
thirty_days_ago = today - timezone.timedelta(days = 30)
Expand All @@ -434,9 +434,8 @@ def _get_last_30_days_count(self, action):

#Gets row information for the All Actions CSV and the All Communities and Actions CSV
def _get_action_info_cells(self, action):

average_carbon_points = (
AverageImpact(action.calculator_action, action.date_completed)
AverageImpact(action.calculator_action)
if action.calculator_action
else int(action.average_carbon_score)
if action.average_carbon_score.isdigit()
Expand Down Expand Up @@ -1007,7 +1006,6 @@ def _community_actions_download(self, community_id):

columns = self.action_info_columns
data = [columns]

for action in actions:
data.append(self._get_action_info_cells(action))

Expand Down
2 changes: 1 addition & 1 deletion src/api_version_dev.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.12.21
4.12.22
4 changes: 2 additions & 2 deletions src/carbon_calculator/CCDefaults.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def loadDefaults(self):
cq = CalcDefault.objects.all()
for c in cq:
# valid date is 0 if not specified
date = '2000-01-01'
date = datetime.strptime('2000-01-01','%Y-%m-%d').date()
if c.valid_date != None:
date = c.valid_date

Expand Down Expand Up @@ -91,7 +91,7 @@ def getDefault(self, locality, variable, date, default=None):
value = var["values"][-1]
else:
for i in range(len(var["valid_dates"])):
valid_date = datetime.strptime(var["valid_dates"][i], '%Y-%m-%d').date()
valid_date = var["valid_dates"][i]
if valid_date < date:
value = var["values"][i]
return value
Expand Down
2 changes: 1 addition & 1 deletion src/deployment/build.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"dev": "4.12.21",
"dev": "4.12.22",
"prod": "4.12.1",
"canary": "4.12.1"
}
3 changes: 1 addition & 2 deletions src/task_queue/database_tasks/update_actions_content.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def update_actions_content(task=None):
ccActionName = item[t["Carbon Calculator Action"]]

# locate the Action from title and community
action = Action.objects.filter(title=action_title, community=community)
action = Action.objects.filter(title=action_title, community=community, is_deleted=False)
if action:
action = action.first()

Expand Down Expand Up @@ -112,7 +112,6 @@ def update_actions_content(task=None):
print("Carbon calculator action '"+ccActionName+"' does not exist")
continue
action.calculator_action = ccAction.first()

action.save()


Expand Down

0 comments on commit 60db4d9

Please sign in to comment.