Skip to content

Commit dd479c7

Browse files
committed
Rename env var
1 parent 21de4e0 commit dd479c7

File tree

6 files changed

+4
-8
lines changed

6 files changed

+4
-8
lines changed

api/management/commands/ingest_gdacs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def handle(self, *args, **options):
6060
"event_type": alert[nspace + "eventtype"],
6161
"alert_level": levels[alert_level],
6262
"alert_score": alert_score,
63-
"severity": alert[nspace + "severity"]["#text"],
63+
"severity": alert[nspace + "severity"].get("#text"),
6464
"severity_unit": alert[nspace + "severity"]["@unit"],
6565
"severity_value": alert[nspace + "severity"]["@value"],
6666
"population_unit": alert[nspace + "population"]["@unit"],

api/management/commands/ingest_ns_document.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def handle(self, *args, **kwargs):
1717

1818
# Fetch country codes
1919
country_code_url = "https://go-api.ifrc.org/api/NationalSocietiesContacts/"
20-
headers = {'Authorization': f'Basic {settings.NS_DOCUMENT_API_TOKEN}'}
20+
headers = {'Authorization': f'Basic {settings.NS_INITIATIVES_API_TOKEN}'}
2121
country_code_response = requests.get(url=country_code_url, headers=headers)
2222

2323
if country_code_response.status_code != 200:

databank/management/commands/fdrs_annual_income.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,4 @@ def handle(self, *args, **kwargs):
3333
}
3434
fdrs_data_count += 1
3535
FDRSAnnualIncome.objects.get_or_create(**data)
36-
print(f'create count {fdrs_data_count}')
3736
logger.info(f"Successfully created {fdrs_data_count} country data")

databank/management/commands/ingest_climate.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,7 @@ def handle(self, *args, **options):
7272
precipitation=precipitation_monthly
7373
)
7474
logger.info('Minimum, maximum and Average temperature of country temperature data added successfully')
75-
print('Minimum, maximum and Average temperature of country temperature data added successfully')
7675

7776
except Exception as ex:
7877
logger.error(f'Error in ingesting climate data: {ex}')
79-
print(f'Error in ingesting climate data: {ex}')
8078
continue

databank/management/commands/ingest_worldbank.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ def handle(self, *args, **kwargs):
7373
existing_data = next((data for data in country_dict[geo_id] if data[2] == indicator), None)
7474
if existing_data is None or existing_data[1] < year:
7575
country_dict[geo_id].append((pop, year, indicator))
76-
print(country_dict)
7776
logger.info(json.dumps(country_dict))
7877
if 'pages' in response.json()[0]:
7978
if page >= response.json()[0]['pages']:

main/settings.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@
103103
ACAPS_API_TOKEN=(str, None),
104104
NS_DOCUMENT_API_KEY=(str, None),
105105
NS_INITIATIVES_API_KEY=(str, None),
106-
NS_DOCUMENT_API_TOKEN=(str, None)
106+
NS_INITIATIVES_API_TOKEN=(str, None)
107107
)
108108

109109

@@ -525,7 +525,7 @@
525525
ACAPS_API_TOKEN = env('ACAPS_API_TOKEN')
526526
NS_DOCUMENT_API_KEY = env('NS_DOCUMENT_API_KEY')
527527
NS_INITIATIVES_API_KEY = env('NS_INITIATIVES_API_KEY')
528-
NS_DOCUMENT_API_TOKEN = env('NS_DOCUMENT_API_TOKEN')
528+
NS_INITIATIVES_API_TOKEN = env('NS_INITIATIVES_API_TOKEN')
529529

530530
DREF_OP_UPDATE_FINAL_REPORT_UPDATE_ERROR_MESSAGE = "OBSOLETE_PAYLOAD"
531531

0 commit comments

Comments
 (0)