File tree 1 file changed +6
-4
lines changed
1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change 1
1
"""Provides classes for handling API requests."""
2
+
2
3
# -*- coding: utf-8 -*-
3
4
from distutils .util import strtobool
4
5
import itertools
@@ -647,9 +648,7 @@ def request_geonames(request):
647
648
"bbox" : geojson ,
648
649
"adminName2" : f'ISO3 : { feature ["properties" ]["iso_3" ]} ' ,
649
650
"name" : request .GET .get ("q" ),
650
- "countryName" : feature ["properties" ][
651
- "name"
652
- ],
651
+ "countryName" : feature ["properties" ]["name" ],
653
652
"adminName1" : feature ["properties" ]["cid" ],
654
653
}
655
654
@@ -697,7 +696,10 @@ def request_geonames(request):
697
696
if len (lst ) >= 1 :
698
697
keyword = lst [1 ]
699
698
if tm_url :
700
- tm_res = requests .get (f"{ tm_url } /{ int (keyword )} /" )
699
+ try :
700
+ tm_res = requests .get (f"{ tm_url } /{ int (keyword )} /" )
701
+ except Exception as ex :
702
+ pass
701
703
if tm_res .ok :
702
704
tm_res = tm_res .json ()
703
705
if "areaOfInterest" in tm_res :
You can’t perform that action at this time.
0 commit comments