diff options
author | Sean McGivern <sean@gitlab.com> | 2016-08-18 15:49:32 +0100 |
---|---|---|
committer | Sean McGivern <sean@gitlab.com> | 2016-08-18 15:54:07 +0100 |
commit | 8b1656282bcc39a0c1c7a3dccf74c98b1c3adae2 (patch) | |
tree | a5375c1ff8150d7777a120f29cfbd4d544ca4865 /app/models/project_team.rb | |
parent | 21a73302e8a8b9f22e51f1707a306f04d3faad07 (diff) | |
parent | 2c1062f81e3c39cf8a45185c203995a43b91bf65 (diff) | |
download | gitlab-ce-8b1656282bcc39a0c1c7a3dccf74c98b1c3adae2.tar.gz |
Merge branch 'master' into expiration-date-on-memberships
Diffstat (limited to 'app/models/project_team.rb')
-rw-r--r-- | app/models/project_team.rb | 11 |
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 |