better course country detecton
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user