From ba90fa20a72912c513f8c3ab8901e802e512de35 Mon Sep 17 00:00:00 2001 From: Jeremy Stretch Date: Tue, 11 Mar 2025 10:31:35 -0400 Subject: [PATCH] Fixes #227: Fix scripts trigged via an event rule when the branching plugin is installed --- netbox_branching/utilities.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/netbox_branching/utilities.py b/netbox_branching/utilities.py index 044c567..7ffd7c3 100644 --- a/netbox_branching/utilities.py +++ b/netbox_branching/utilities.py @@ -258,6 +258,6 @@ def ActiveBranchContextManager(request): """ Activate a branch if indicated by the request. """ - if branch := get_active_branch(request): + if request and (branch := get_active_branch(request)): return activate_branch(branch) return nullcontext()