Skip to content

Commit

Permalink
Refactor to reduce length of lines.
Browse files Browse the repository at this point in the history
  • Loading branch information
Letizia97 committed Feb 3, 2023
1 parent 8759091 commit 973b41b
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions monitoring/publishing/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,19 @@ def update_dict_stdout_and_returncode(single_dict, date):


def fill_summaries_dict(inpDict, row):
inpDict["Site"] = inpDict.get("Site") + [row.Site]
inpDict["Month"] = inpDict.get("Month") + [row.Month]
inpDict["Year"] = inpDict.get("Year") + [row.Year]
inpDict["RecordCountPublished"] = inpDict.get("RecordCountPublished") + [row.RecordCountPublished]
inpDict["RecordStart"] = inpDict.get("RecordStart") + [row.RecordStart]
inpDict["RecordEnd"] = inpDict.get("RecordEnd") + [row.RecordEnd]

fields_to_update_and_value_to_add = {
"Site": row.Site,
"Month": row.Month,
"Year": row.Year,
"RecordCountPublished": row.RecordCountPublished,
"RecordStart": row.RecordStart,
"RecordEnd": row.RecordEnd,
}

for field, value in fields_to_update_and_value_to_add.items():
inpDict[field] = inpDict.get(field) + [value]

if hasattr(row, "SubmitHostSumm"):
inpDict["SubmitHostSumm"] = inpDict.get("SubmitHostSumm") + [row.SubmitHostSumm]

Expand Down

0 comments on commit 973b41b

Please sign in to comment.