Skip to content

Commit 232cb2c

Browse files
committed
Remove review requested event trigger for now
1 parent 935197d commit 232cb2c

File tree

1 file changed

+0
-23
lines changed

1 file changed

+0
-23
lines changed

backend/infrahub/graphql/mutations/proposed_change.py

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
ProposedChangeApprovedEvent,
2323
ProposedChangeRejectedEvent,
2424
ProposedChangeRejectionRevokedEvent,
25-
ProposedChangeReviewRequestedEvent,
2625
)
2726
from infrahub.exceptions import BranchNotFoundError, PermissionDeniedError, ValidationError
2827
from infrahub.graphql.mutations.main import InfrahubMutationMixin
@@ -131,9 +130,6 @@ async def mutate_update(
131130
updated_state = ProposedChangeState(state_update)
132131
state.validate_state_transition(updated_state)
133132

134-
was_draft = obj.is_draft.value
135-
still_draft = data.get("is_draft", {"value": was_draft}).get("value")
136-
137133
# Check before starting a transaction, stopping in the middle of the transaction seems to break with memgraph
138134
if updated_state == ProposedChangeState.MERGED and graphql_context.account_session:
139135
try:
@@ -167,25 +163,6 @@ async def mutate_update(
167163
# correct value for the event that will be generated.
168164
proposed_change.node_changelog.attributes["state"].value = ProposedChangeState.MERGED.value
169165

170-
# If the proposed change was in draft but isn't anymore, send the review requested event
171-
if was_draft and not still_draft:
172-
current_user = await NodeManager.get_one(
173-
db=graphql_context.db,
174-
kind=InfrahubKind.GENERICACCOUNT,
175-
id=graphql_context.active_account_session.account_id,
176-
)
177-
event_service = await get_event_service()
178-
await event_service.send(
179-
event=ProposedChangeReviewRequestedEvent(
180-
proposed_change_id=proposed_change.id,
181-
proposed_change_name=proposed_change.name.value,
182-
proposed_change_state=proposed_change.state.value,
183-
requested_by_account_id=current_user.id,
184-
requested_by_account_name=current_user.name.value,
185-
meta=EventMeta.from_context(context=graphql_context.get_context()),
186-
)
187-
)
188-
189166
return proposed_change, result
190167

191168

0 commit comments

Comments
 (0)