Skip to content

Commit

Permalink
feat: use metadata in actions instead of translated title
Browse files Browse the repository at this point in the history
  • Loading branch information
rboixaderg committed Jan 19, 2024
1 parent 7d48a03 commit cace7e8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion guillotina/contrib/workflows/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ async def __call__(self):
{
"@id": obj_url + "/@workflow/" + action_name,
"title": action["title"],
"translated_title": action.get("translated_title", {}),
"metadata": action.get("metadata", {}),
}
)

Expand Down
6 changes: 2 additions & 4 deletions guillotina/tests/workflows/test_workflow_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ async def test_workflow_basic(container_requester):
async with container_requester as requester:
response, _ = await requester("GET", "/db/guillotina/@workflow")
assert response["transitions"][0]["title"] == "Publish"
assert response["transitions"][0]["translated_title"] == {}
assert response["transitions"][0]["metadata"] == {}

response, _ = await requester("GET", "/db/guillotina")
assert response["review_state"] == "private"
Expand All @@ -33,9 +33,7 @@ async def test_workflow_basic(container_requester):
assert response["review_state"] == "public"

response, _ = await requester("GET", "/db/guillotina/@sharing")
assert (
response["local"]["roleperm"]["guillotina.Anonymous"]["guillotina.AccessContent"] == "AllowSingle"
)
assert response["local"]["roleperm"]["guillotina.Anonymous"]["guillotina.AccessContent"] == "AllowSingle"

response, status = await requester("GET", "/db/guillotina", token=None)
assert status == 200
Expand Down

0 comments on commit cace7e8

Please sign in to comment.