Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/project_team.rb')
-rw-r--r--app/models/project_team.rb11
1 files changed, 8 insertions, 3 deletions
diff --git a/app/models/project_team.rb b/app/models/project_team.rb
index 1865c5253e2..a65d271d262 100644
--- a/app/models/project_team.rb
+++ b/app/models/project_team.rb
@@ -34,7 +34,7 @@ class ProjectTeam
end
def add_users(users, access, current_user: nil, expires_at: nil)
- ProjectMember.add_users_into_projects(
+ ProjectMember.add_users_to_projects(
[project.id],
users,
access,
@@ -139,8 +139,13 @@ class ProjectTeam
def max_member_access_for_user_ids(user_ids)
user_ids = user_ids.uniq
key = "max_member_access:#{project.id}"
- RequestStore.store[key] ||= {}
- access = RequestStore.store[key]
+
+ access = {}
+
+ if RequestStore.active?
+ RequestStore.store[key] ||= {}
+ access = RequestStore.store[key]
+ end
# Lookup only the IDs we need
user_ids = user_ids - access.keys