Skip to content
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
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "python-catalyst"
version = "0.1.3"
version = "0.1.4"
description = "Python client for the PRODAFT CATALYST API"
readme = "README.md"
license = { file = "LICENSE" }
Expand Down
15 changes: 7 additions & 8 deletions python_catalyst/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,14 +148,13 @@ def get_member_contents(

if tlp:
if len(tlp) > 0:
first_tlp = tlp[0]
params["tlp"] = (
first_tlp.value if isinstance(first_tlp, TLPLevel) else first_tlp
)
if len(tlp) > 1:
self.logger.debug(
f"Multiple TLP values provided but API only supports one. Using: {params['tlp']}"
)
tlps = []
for t in tlp:
if isinstance(t, TLPLevel):
tlps.append(t.value)
else:
tlps.append(t)
params["tlp"] = tlps

if published_on_after:
params["published_on_after"] = published_on_after.isoformat()
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setup(
name="python-catalyst",
version="0.1.3",
version="0.1.4",
description="Python client for the PRODAFT CATALYST API",
long_description=long_description,
long_description_content_type="text/markdown",
Expand Down
2 changes: 1 addition & 1 deletion tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def test_get_member_contents(self, mock_handle_request):
self.client.content_endpoint,
params={
"category": "RESEARCH",
"tlp": "TLP:AMBER",
"tlp": ["TLP:AMBER"],
"published_on_after": test_datetime.isoformat(),
"published_on_before": test_datetime.isoformat(),
"updated_on_after": test_datetime.isoformat(),
Expand Down