Skip to content

Commit

Permalink
Merge pull request #420 from ropable/master
Browse files Browse the repository at this point in the history
Bugfix wfs_getfeature function
  • Loading branch information
ropable authored Oct 8, 2024
2 parents 3daeb9b + 465667d commit 44a7f4e
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 19 deletions.
2 changes: 1 addition & 1 deletion kustomize/overlays/prod/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ patches:
- path: typesense_service_patch.yaml
images:
- name: ghcr.io/dbca-wa/prs
newTag: 2.5.59
newTag: 2.5.60
22 changes: 11 additions & 11 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 10 additions & 3 deletions prs2/referral/utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import json
import logging
import re
from datetime import date, datetime

Expand Down Expand Up @@ -305,7 +306,7 @@ def overdue_task_email():
return True


def wfs_getfeature(type_name, crs="EPSG:4326", cql_filter=None, max_features=50):
def wfs_getfeature(type_name, cql_filter=None, crs="EPSG:4326", max_features=50):
"""A utility function to perform a GetFeature request on a WFS endpoint
and return results as GeoJSON.
"""
Expand All @@ -326,7 +327,10 @@ def wfs_getfeature(type_name, crs="EPSG:4326", cql_filter=None, max_features=50)
try:
resp.raise_for_status()
response = resp.json()
except:
except Exception as e:
logger = logging.getLogger("prs")
logger.warning(f"Exception during WFS getFeature request to {url}: {params}")
logger.warning(e)
# On exception, return an empty dict.
return {}

Expand All @@ -342,7 +346,10 @@ def query_caddy(q):
try:
resp.raise_for_status()
response = resp.json()
except:
except Exception as e:
logger = logging.getLogger("prs")
logger.warning(f"Exception during query: {url}?q={q}")
logger.warning(e)
# On exception, return an empty list.
return []

Expand Down
8 changes: 4 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "prs"
version = "2.5.59"
version = "2.5.60"
description = "Planning Referral System corporate application"
authors = ["Ashley Felton <[email protected]>"]
license = "Apache-2.0"
Expand All @@ -22,7 +22,7 @@ pillow = "10.4.0"
python-magic = "0.4.27"
lxml = { version = "5.3.0", extras = ["html-clean"] }
xmltodict = "0.13.0"
extract-msg = "0.49.0"
extract-msg = "0.50.0"
django-extensions = "3.2.3"
webtemplate-dbca = "1.7.1"
mixer = "7.2.2"
Expand All @@ -35,8 +35,8 @@ django-celery-results = "2.5.1"
pygeopkg = "0.1.3"
whitenoise = { version = "6.7.0", extras = ["brotli"] }
django-crum = "0.7.9"
sentry-sdk = { version = "2.14.0", extras = ["django"] }
crispy-bootstrap5 = "2024.2"
sentry-sdk = { version = "2.15.0", extras = ["django"] }
crispy-bootstrap5 = "2024.10"
redis = "5.1.1"
xlsxwriter = "3.2.0"
django-storages = { version = "1.14.4", extras = ["azure"] }
Expand Down

0 comments on commit 44a7f4e

Please sign in to comment.