Skip to content

Commit b51d5b2

Browse files
authored
Merge pull request #7 from openagri-eu/disable-parcel-without-farmc
update: Disable parcel without GK
2 parents 21cc0c6 + c109c6a commit b51d5b2

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

app/utils/utils.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,15 +61,18 @@ def decode_dates_filters(params: dict, from_date: datetime.date = None, to_date
6161

6262

6363
def get_parcel_info(parcel_id: str, token: dict, geolocator: Nominatim, identifier_flag: bool = False):
64+
address = ''
65+
farm = ''
66+
identifier = ''
67+
if not settings.REPORTING_USING_GATEKEEPER:
68+
return address, farm, identifier
6469
farm_parcel_info = make_get_request(
6570
url=f'{settings.REPORTING_FARMCALENDAR_BASE_URL}{settings.REPORTING_FARMCALENDAR_URLS["parcel"]}{parcel_id}/',
6671
token=token,
6772
params={"format": "json"}
6873
)
6974
location = farm_parcel_info.get("location")
70-
address = ''
71-
farm = ''
72-
identifier = ''
75+
7376
try:
7477
identifier = farm_parcel_info.get("identifier")
7578
if location:

0 commit comments

Comments
 (0)