summaryrefslogtreecommitdiff
path: root/app/models
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2016-08-01 13:11:45 -0700
committerStan Hu <stanhu@gmail.com>2016-08-01 13:11:45 -0700
commit99c02ed53c994fbd71442410c78daf220c6d1ced (patch)
tree62ce3f5d605e086c366ed2d850e2c0832794dd71 /app/models
parentaa727434d7619956c43c2d72d2edd8a3bd61f535 (diff)
downloadgitlab-ce-99c02ed53c994fbd71442410c78daf220c6d1ced.tar.gz
Only use RequestStore in ProjectTeam#max_member_access_for_user if it is active
Diffstat (limited to 'app/models')
-rw-r--r--app/models/project_team.rb9
1 files changed, 7 insertions, 2 deletions
diff --git a/app/models/project_team.rb b/app/models/project_team.rb
index fdfaf052730..19fd082534c 100644
--- a/app/models/project_team.rb
+++ b/app/models/project_team.rb
@@ -138,8 +138,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