diff --git a/service/service.py b/service/service.py index 720c303..8871a44 100644 --- a/service/service.py +++ b/service/service.py @@ -40,12 +40,12 @@ class PointService: req_url = f"https://geocode.search.hereapi.com/v1/geocode?q={addr}&apiKey={GEOCODER_API_KEY}" response = requests.get(req_url).json().get('items') if not response: - models.PrePlacementPoint.objects.create(address=addr, matching_status=MatchingStatus.Error.name) + models.PrePlacementPoint.objects.create(address=addr, matching_status=MatchingStatus.Error.name, status=PointStatus.Pending.name) problem += 1 continue coords = response[0].get('position') if not coords: - models.PrePlacementPoint.objects.create(address=addr, matching_status=MatchingStatus.Error.name) + models.PrePlacementPoint.objects.create(address=addr, matching_status=MatchingStatus.Error.name, status=PointStatus.Pending.name) problem += 1 continue wkt = "POINT(" + str(coords['lng']) + " " + str(coords['lat']) + ")" @@ -73,7 +73,7 @@ class PointService: category=cat, geometry=wkt, sample_trn=False, is_vis=True, matching_status=MatchingStatus.Error.name, - status=PointStatus.Pending.name) + status=PointStatus.Unmatched.name) problem += 1 else: models.PrePlacementPoint.objects.get_or_create(address=addr, street=response.get('street'),