Skip to content

Commit

Permalink
display related planning items also for secondary links
Browse files Browse the repository at this point in the history
STT-70
  • Loading branch information
petrjasek committed Sep 6, 2024
1 parent c0b35a6 commit 6a85373
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 9 additions & 0 deletions server/features/events.feature
Original file line number Diff line number Diff line change
Expand Up @@ -1713,6 +1713,15 @@ Feature: Events
"""
{"related_events": [{"_id": "#events._id#", "link_type": "secondary"}]}
"""
When we get "/events/event_1"
Then we get existing resource
"""
{
"planning_ids": [
"plan1"
]
}
"""

@auth
Scenario: Link new Event with one_primary link method
Expand Down
2 changes: 1 addition & 1 deletion server/planning/events/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ def on_fetched_item(self, doc):
self._enhance_event_item(doc)

def _enhance_event_item(self, doc):
plannings = get_related_planning_for_events([doc[config.ID_FIELD]], "primary")
plannings = get_related_planning_for_events([doc[config.ID_FIELD]])

if len(plannings):
doc["planning_ids"] = [planning.get("_id") for planning in plannings]
Expand Down

0 comments on commit 6a85373

Please sign in to comment.