Skip to content

Commit

Permalink
Merge branch 'main' of github.com:BLSQ/openhexa-toolbox
Browse files Browse the repository at this point in the history
  • Loading branch information
yannforget committed Sep 26, 2024
2 parents 738fe8d + 9d41318 commit dd6aa1c
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "1.1.0"
".": "1.1.2"
}
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# Changelog

## [1.1.2](https://github.com/BLSQ/openhexa-toolbox/compare/v1.1.1...v1.1.2) (2024-09-23)


### Bug Fixes

* **dhis2:** do not raise authentication errors for status codes 406 ([d0af883](https://github.com/BLSQ/openhexa-toolbox/commit/d0af883d9b710073cbb9aa8c73698017fc6d6e97))

## [1.1.1](https://github.com/BLSQ/openhexa-toolbox/compare/v1.1.0...v1.1.1) (2024-09-23)


### Bug Fixes

* **dhis2:** do not raise authentication errors for old versions ([3e0eb93](https://github.com/BLSQ/openhexa-toolbox/commit/3e0eb93321dbab65c973847220298f0dad484424))

## [1.1.0](https://github.com/BLSQ/openhexa-toolbox/compare/v1.0.2...v1.1.0) (2024-08-27)


Expand Down
8 changes: 6 additions & 2 deletions openhexa/toolbox/dhis2/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,12 @@ def authenticate(self, username: str, password: str) -> requests.Session:
s = requests.Session()
s.auth = requests.auth.HTTPBasicAuth(username, password)
r = s.get(f"{self.url}/system/ping")
self.raise_if_error(r)
logger.info(f"Logged in to '{self.url}' as '{username}'")
# some old instances doesn't have a "system/ping" endpoint
# we don't want to raise an error in that case
if r.status_code in [200, 406]:
logger.info(f"Logged in to '{self.url}' as '{username}'")
else:
self.raise_if_error(r)
return s

def get(self, endpoint: str, params: dict = None, use_cache: bool = True) -> dict:
Expand Down
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "openhexa.toolbox"
version = "1.1.0"
version = "1.1.2"
description = "A set of tools to acquire & process data from various sources"
authors = [{ name = "Bluesquare", email = "dev@bluesquarehub.com" }]
maintainers = [{ name = "Bluesquare", email = "dev@bluesquarehub.com" }]
Expand All @@ -29,11 +29,11 @@ dependencies = [

[project.optional-dependencies]
dev = [
"ruff~=0.5.2",
"ruff~=0.6.5",
"pytest~=8.3.2",
"build~=1.2.1",
"pytest-cov~=5.0.0",
"black~=24.4.2",
"black~=24.8.0",
"pre-commit",
"responses",
]
Expand Down

0 comments on commit dd6aa1c

Please sign in to comment.