Skip to content

Commit

Permalink
fix refs in jimi pictures to be only for published content (#184)
Browse files Browse the repository at this point in the history
SDCP-705
  • Loading branch information
petrjasek authored Sep 13, 2023
1 parent 66a62fc commit 59b4a84
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
8 changes: 6 additions & 2 deletions server/cp/output/formatter/jimi.py
Original file line number Diff line number Diff line change
Expand Up @@ -559,9 +559,13 @@ def _format_refs(self, content, item):
[
slug(self._get_original_item(ref))
for ref in superdesk.get_resource_service("news").get(
req=None, lookup={"refs.guid": item["guid"]}
req=None,
lookup={
"refs.guid": item["guid"],
"pubstatus": "usable",
"state": "published",
},
)
if ref.get("pubstatus") == "usable"
]
)

Expand Down
1 change: 0 additions & 1 deletion server/tests/output/formatter/jimi_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,6 @@ def test_ap_update_keeps_newscomip(self):
def test_picture_container_ids(self):
resources["news"].service.get.side_effect = [
[
{"guid": "canceled", "pubstatus": "canceled", "type": "text"},
{"guid": "usable", "pubstatus": "usable", "type": "text"},
{
"guid": "usable2",
Expand Down

0 comments on commit 59b4a84

Please sign in to comment.