Skip to content

Commit

Permalink
Add commit id in qjazz context
Browse files Browse the repository at this point in the history
  • Loading branch information
dmarteau committed Jan 14, 2025
1 parent 4d276de commit 9d2d28f
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 4 deletions.
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ tests:

.PHONY: test

install-tests:
install-tests: install-dev

install-dev:
pip install -U --upgrade-strategy=eager -r requirements/dev.txt

export QGIS_SERVER_LIZMAP_REVEAL_SETTINGS=TRUE
Expand Down
7 changes: 7 additions & 0 deletions lizmap_server/context/qjazz.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,16 @@ def metadata(self) -> ServerMetadata:
""" Return server metadata
"""
from importlib import metadata
from qjazz_contrib.core import manifest

commit = manifest.get_manifest().commit_id
if commit:
commit = commit[:12]

version = metadata.version('qjazz_cache')
return ServerMetadata(
name=SERVER_CONTEXT_NAME,
commit_id=commit,
version=version,
is_stable=not any(x in version for x in ("pre", "alpha", "beta", "rc", "dev")),
)
2 changes: 1 addition & 1 deletion lizmap_server/expression_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -910,7 +910,7 @@ def virtualFields(params: Dict[str, str], response: QgsServerResponse, project:
req_sorting_field = params.get('SORTING_FIELD', '')
order_by_clause = QgsFeatureRequest.OrderByClause(req_sorting_field, req_sorting_order_param == 'asc')
req.setOrderBy(QgsFeatureRequest.OrderBy([order_by_clause]))
elif req_sorting_order_param != '' :
elif req_sorting_order_param != '':
raise ExpressionServiceError(
"Bad request error",
f"Invalid SORTING_ORDER for 'VirtualFields': \"{req_sorting_order_param}\"",
Expand Down
2 changes: 0 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ extend-select = [
"RUF",
]
ignore = [
"ANN101",
"ANN102",
"ANN002",
"ANN003",
"RUF100",
Expand Down
1 change: 1 addition & 0 deletions test/test_expression_service_virtualfields.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ def test_request_with_filter_fields_geometry(client):
assert 'b' in b['features'][0]['properties']
assert b['features'][0]['properties']['b'] == 2


def test_request_limit(client):
""" Test Expression VirtualFields request
"""
Expand Down

0 comments on commit 9d2d28f

Please sign in to comment.