Location map uses a separate cache and defaults to general
This commit is contained in:
@@ -203,8 +203,7 @@ def remove_user_from_course_group(caller, user, location, role):
|
||||
|
||||
# see if the user is actually in that role, if not then we don't have to do anything
|
||||
groupnames, _ = get_all_course_role_groupnames(location, role)
|
||||
for group in user.groups.filter(name__in=groupnames):
|
||||
user.groups.remove(group)
|
||||
user.groups.remove(*user.groups.filter(name__in=groupnames))
|
||||
user.save()
|
||||
|
||||
|
||||
|
||||
@@ -129,7 +129,12 @@ CACHES = {
|
||||
'LOCATION': '/var/tmp/mongo_metadata_inheritance',
|
||||
'TIMEOUT': 300,
|
||||
'KEY_FUNCTION': 'util.memcache.safe_key',
|
||||
}
|
||||
},
|
||||
'loc_cache': {
|
||||
'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',
|
||||
'LOCATION': 'edx_location_mem_cache',
|
||||
},
|
||||
|
||||
}
|
||||
|
||||
# Make the keyedcache startup warnings go away
|
||||
|
||||
@@ -138,7 +138,12 @@ CACHES = {
|
||||
'LOCATION': '/var/tmp/mongo_metadata_inheritance',
|
||||
'TIMEOUT': 300,
|
||||
'KEY_FUNCTION': 'util.memcache.safe_key',
|
||||
}
|
||||
},
|
||||
'loc_cache': {
|
||||
'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',
|
||||
'LOCATION': 'edx_location_mem_cache',
|
||||
},
|
||||
|
||||
}
|
||||
|
||||
# hide ratelimit warnings while running tests
|
||||
|
||||
@@ -129,8 +129,12 @@ def loc_mapper():
|
||||
global _loc_singleton
|
||||
# pylint: disable=W0212
|
||||
if _loc_singleton is None:
|
||||
try:
|
||||
loc_cache = get_cache('loc_cache')
|
||||
except InvalidCacheBackendError:
|
||||
loc_cache = get_cache('default')
|
||||
# instantiate
|
||||
_loc_singleton = LocMapperStore(get_cache('default'), **settings.DOC_STORE_CONFIG)
|
||||
_loc_singleton = LocMapperStore(loc_cache, **settings.DOC_STORE_CONFIG)
|
||||
# inject into split mongo modulestore
|
||||
if 'split' in _MODULESTORES:
|
||||
_MODULESTORES['split'].loc_mapper = _loc_singleton
|
||||
|
||||
@@ -85,7 +85,11 @@ CACHES = {
|
||||
'LOCATION': '/var/tmp/mongo_metadata_inheritance',
|
||||
'TIMEOUT': 300,
|
||||
'KEY_FUNCTION': 'util.memcache.safe_key',
|
||||
}
|
||||
},
|
||||
'loc_cache': {
|
||||
'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',
|
||||
'LOCATION': 'edx_location_mem_cache',
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -165,7 +165,12 @@ CACHES = {
|
||||
'LOCATION': '/var/tmp/mongo_metadata_inheritance',
|
||||
'TIMEOUT': 300,
|
||||
'KEY_FUNCTION': 'util.memcache.safe_key',
|
||||
}
|
||||
},
|
||||
'loc_cache': {
|
||||
'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',
|
||||
'LOCATION': 'edx_location_mem_cache',
|
||||
},
|
||||
|
||||
}
|
||||
|
||||
# Dummy secret key for dev
|
||||
|
||||
Reference in New Issue
Block a user