Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add commit id in qjazz context #103

Merged
merged 1 commit into from
Jan 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading