|
22 | 22 | ProposedChangeApprovedEvent,
|
23 | 23 | ProposedChangeRejectedEvent,
|
24 | 24 | ProposedChangeRejectionRevokedEvent,
|
25 |
| - ProposedChangeReviewRequestedEvent, |
26 | 25 | )
|
27 | 26 | from infrahub.exceptions import BranchNotFoundError, PermissionDeniedError, ValidationError
|
28 | 27 | from infrahub.graphql.mutations.main import InfrahubMutationMixin
|
@@ -131,9 +130,6 @@ async def mutate_update(
|
131 | 130 | updated_state = ProposedChangeState(state_update)
|
132 | 131 | state.validate_state_transition(updated_state)
|
133 | 132 |
|
134 |
| - was_draft = obj.is_draft.value |
135 |
| - still_draft = data.get("is_draft", {"value": was_draft}).get("value") |
136 |
| - |
137 | 133 | # Check before starting a transaction, stopping in the middle of the transaction seems to break with memgraph
|
138 | 134 | if updated_state == ProposedChangeState.MERGED and graphql_context.account_session:
|
139 | 135 | try:
|
@@ -167,25 +163,6 @@ async def mutate_update(
|
167 | 163 | # correct value for the event that will be generated.
|
168 | 164 | proposed_change.node_changelog.attributes["state"].value = ProposedChangeState.MERGED.value
|
169 | 165 |
|
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 |
| - |
189 | 166 | return proposed_change, result
|
190 | 167 |
|
191 | 168 |
|
|
0 commit comments