Skip to content

Commit 4f6b7f2

Browse files
authored
Chore Temporarily ignore ssl verification (#112)
* Temporarily ignore ssl verification * Ensure location is saved
1 parent b7fbdd0 commit 4f6b7f2

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

sensorsafrica/management/commands/add_city_names.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ def handle(self, *args, **options):
2121
continue
2222
city = location.raw['address'].get('city')
2323
node.location.city = city
24-
node.save()
24+
node.location.save()

sensorsafrica/management/commands/upload_to_ckan.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import time
55

66
import ckanapi
7+
import requests
78
import pytz
89
from django.core.management import BaseCommand
910
from django.db.models import Max, Min
@@ -19,7 +20,10 @@ def handle(self, *args, **options):
1920
CKAN_ARCHIVE_OWNER_ID = os.environ.get("CKAN_ARCHIVE_OWNER_ID")
2021
CKAN_ARCHIVE_URL = os.environ.get("CKAN_ARCHIVE_URL")
2122

22-
ckan = ckanapi.RemoteCKAN(CKAN_ARCHIVE_URL, apikey=CKAN_ARCHIVE_API_KEY)
23+
session = requests.Session()
24+
session.verify = False
25+
26+
ckan = ckanapi.RemoteCKAN(CKAN_ARCHIVE_URL, apikey=CKAN_ARCHIVE_API_KEY, session=session)
2327

2428
city_queryset = (
2529
SensorLocation.objects.all()

0 commit comments

Comments
 (0)