File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
backend/infrahub/graphql/mutations Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -264,7 +264,7 @@ async def mutate(
264
264
)
265
265
266
266
async with graphql_context .db .start_session () as db :
267
- await cls ._handle_decision (
267
+ event = await cls ._handle_decision (
268
268
db = db ,
269
269
decision = data .decision ,
270
270
proposed_change = proposed_change ,
@@ -273,6 +273,10 @@ async def mutate(
273
273
)
274
274
await proposed_change .save (db = db )
275
275
276
+ if event :
277
+ event_service = await get_event_service ()
278
+ await event_service .send (event = event )
279
+
276
280
return {"ok" : True }
277
281
278
282
@classmethod
@@ -283,7 +287,7 @@ async def _handle_decision(
283
287
proposed_change : CoreProposedChange ,
284
288
current_user : Node ,
285
289
context : GraphqlContext ,
286
- ) -> None :
290
+ ) -> InfrahubEvent | None :
287
291
"""Modify approved_by and rejected_by relationships of the prpoposed change based on the decision."""
288
292
289
293
approved_by = await proposed_change .approved_by .get_peers (db = db )
@@ -365,9 +369,7 @@ async def _handle_decision(
365
369
case _:
366
370
raise ValidationError (input_value = f"Invalid decision { decision } " )
367
371
368
- if event :
369
- event_service = await get_event_service ()
370
- await event_service .send (event = event )
372
+ return event
371
373
372
374
373
375
class ProposedChangeMergeInput (InputObjectType ):
You can’t perform that action at this time.
0 commit comments