From a99ccfdf745f879b9014152026b45f81e3259f7c Mon Sep 17 00:00:00 2001 From: Giteabot Date: Wed, 17 Dec 2025 18:56:58 +0800 Subject: [PATCH] Fix OrgAssignment opts (#36174) (#36177) Backport #36174 by @wxiaoguang Fix #36084 Co-authored-by: wxiaoguang --- services/context/org.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/services/context/org.go b/services/context/org.go index d41bd5ea79..4c64ff72a9 100644 --- a/services/context/org.go +++ b/services/context/org.go @@ -70,8 +70,9 @@ type OrgAssignmentOptions struct { } // OrgAssignment returns a middleware to handle organization assignment -func OrgAssignment(opts OrgAssignmentOptions) func(ctx *Context) { +func OrgAssignment(orgAssignmentOpts OrgAssignmentOptions) func(ctx *Context) { return func(ctx *Context) { + opts := orgAssignmentOpts // it must be a copy, because the values will be changed var err error if ctx.ContextUser == nil { // if Organization is not defined, get it from params