Repository navigation
Skip importing triggers whose flow type isn't allowed for the trigger type - #7131
Merged
rowanseymour merged 2 commits intoOct 21, 2026
Merged
Conversation
|
The approach makes sense: the check has to happen after flow resolution, since the flow may come from the same import, and returning Things to consider:
🤖 Generated with Claude Code |
…yword trigger on a background flow
rowanseymour
deleted the
rowan/ticket-trigger-import-circumvent-75654d
branch
October 21, 2026 18:57
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Each trigger type's allowed flow types were only enforced by the create/update form, so importing a definition could create a trigger the UI wouldn't allow, e.g. a closed ticket trigger on a messaging flow. Imports now skip such triggers.
Changes
Trigger.import_defreturnsNone(skips the trigger) when the resolved flow's type isn't inallowed_flow_typesfor the trigger type, the same way it skips triggers over the org limit.clean_import_def, because the flow may be created by the same import.test_import_invalid: a closed ticket trigger on a messaging flow (skipped, its group not created), a keyword trigger on a background flow (skipped) and a closed ticket trigger on a background flow (imported).Behavior examples
Test plan
temba.triggers,temba.flows,temba.campaigns,temba.orgstests passcode_check.pypasses