Skip to content
This repository has been archived by the owner on Dec 13, 2022. It is now read-only.

Fix bugs from Sentry #213

Merged
merged 3 commits into from
Mar 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion country/management/commands/fetch_covid_active_cases.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def handle(self, *args, **kwargs):
if (
not existing_db_entry
or not existing_db_entry.active_cases_count
or not existing_db_entry.death_cases
or not existing_db_entry.death_count
):
request_string = f"https://covid-api.com/api/reports?iso={country_code}&date={date}"
r = requests.get(request_string)
Expand Down
2 changes: 2 additions & 0 deletions country/management/commands/generate_excel_summary.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import os
import socket

import xlsxwriter
Expand All @@ -12,6 +13,7 @@ class Command(BaseCommand):

def handle(self, *args, **kwargs):
print("Exporting!!!!!!!!")
os.makedirs(os.path.join("media", "export"), exist_ok=True)
workbook = xlsxwriter.Workbook("media/export/overall_summary.xlsx")
worksheet = workbook.add_worksheet()
row = 0
Expand Down
2 changes: 1 addition & 1 deletion country/red_flag.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def flag4(self, contract_id):
)
contract_value = tender_instance["contract_value"]
tender_value = tender_instance["tender_value"]
if contract_value > tender_value:
if tender_value and contract_value > tender_value:
return True
else:
return False
Expand Down