Skip to content

Commit

Permalink
Fix dataset not showing up error
Browse files Browse the repository at this point in the history
  • Loading branch information
kshitijrajsharma committed Dec 14, 2023
1 parent 451459b commit b8337ff
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -623,7 +623,6 @@ def request_geonames(request):
or str(keyword).lower().startswith("tm")
):
response = requests.get(geonames_url, params=payload).json()
print(response)
assert isinstance(response, dict)
if RAW_DATA_API_URL:
if str(keyword).lower().startswith("boundary"):
Expand All @@ -646,7 +645,7 @@ def request_geonames(request):
}
add_resp = {
"bbox": geojson,
"adminName2": feature["properties"]["iso_3"],
"adminName2": f'ISO3 : {feature["properties"]["iso_3"]}',
"name": f'{request.GET.get("q")} -> {feature["properties"]["description"]}',
"countryName": feature["properties"][
"dataset_name"
Expand All @@ -656,6 +655,7 @@ def request_geonames(request):

if "geonames" in response:
response["geonames"].append(add_resp)
response["totalResultsCount"] += 1

if str(keyword).lower().startswith("osm"):
lst = keyword.split(" ")
Expand Down
2 changes: 1 addition & 1 deletion ui/app/components/aoi/ExportAOI.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ export class ExportAOI extends Component {

handleSearch = result => {
var geojson;
if (result.adminName2.startsWith('HOTOSM')){
if (result.adminName2.startsWith('ISO3')){
try {
geojson = JSON.parse(JSON.stringify(result.bbox));
} catch (e) {
Expand Down

0 comments on commit b8337ff

Please sign in to comment.