Private
Public Access
1
0

better course country detecton

This commit is contained in:
Sander Roosendaal
2020-07-12 09:05:08 +02:00
parent f893ad7626
commit 224ae2faa5
4 changed files with 26 additions and 17 deletions

View File

@@ -6,6 +6,7 @@ import os
import requests
import datetime
import arrow
import json
from simplejson.errors import JSONDecodeError
@@ -24,7 +25,10 @@ class Command(BaseCommand):
try:
blogs_json = response.json()
except JSONDecodeError:
blogs_json = []
try:
blogs_json = json.loads(response.text)
except JSONDecodeError:
blogs_json = []
else:
blogs_json = []
except ConnectionError: