From f472a5f8a6663a45c29a1b8aefaa32836eedd6d2 Mon Sep 17 00:00:00 2001 From: Resad Hajdarpasic Date: Wed, 28 Feb 2024 09:34:46 +0100 Subject: [PATCH] fix Django EDR implementation on non-instance endpoints (#1528) (#1549) * fix Django EDR implementation on non-instance endpoints (#1528) * clean up code to follow PEP8 and fix docstring (#1528) * remove trailing comma from view definition args (#1528) --------- Co-authored-by: Resad Hajdarpasic --- pygeoapi/django_/views.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/pygeoapi/django_/views.py b/pygeoapi/django_/views.py index 95df4f0..6a379cd 100644 --- a/pygeoapi/django_/views.py +++ b/pygeoapi/django_/views.py @@ -36,6 +36,7 @@ """Integration module for Django""" from typing import Tuple, Dict, Mapping, Optional + from django.conf import settings from django.http import HttpRequest, HttpResponse @@ -328,7 +329,7 @@ def collection_tiles_metadata(request: HttpRequest, collection_id: str, def collection_item_tiles(request: HttpRequest, collection_id: str, tileMatrixSetId: str, tileMatrix: str, - tileRow: str, tileCol: str,) -> HttpResponse: + tileRow: str, tileCol: str) -> HttpResponse: """ OGC API - Tiles collection tiles data endpoint @@ -430,14 +431,16 @@ def job_results_resource(request: HttpRequest, process_id: str, job_id: str, return response -def get_collection_edr_query(request: HttpRequest, collection_id: str, - instance_id: str) -> HttpResponse: +def get_collection_edr_query( + request: HttpRequest, collection_id: str, + instance_id: Optional[str] = None +) -> HttpResponse: """ OGC API - EDR endpoint - :request Django HTTP Request - :param job_id: job identifier - :param resource: job resource + :param request: Django HTTP Request + :param collection_id: collection identifier + :param instance_id: optional instance identifier. default is None :returns: Django HTTP response """