From 608fceb0b54cba1a571c479aa0bbab1caac4b260 Mon Sep 17 00:00:00 2001 From: David Ormsbee Date: Thu, 26 Jan 2017 09:36:01 -0500 Subject: [PATCH] Remove select_for_update option for FieldDataCache We've already been ignoring the param for a long time. This just removes it entirely. --- lms/djangoapps/courseware/model_data.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/lms/djangoapps/courseware/model_data.py b/lms/djangoapps/courseware/model_data.py index aa11c0d2aa..d450785063 100644 --- a/lms/djangoapps/courseware/model_data.py +++ b/lms/djangoapps/courseware/model_data.py @@ -687,7 +687,7 @@ class FieldDataCache(object): A cache of django model objects needed to supply the data for a module and its descendants """ - def __init__(self, descriptors, course_id, user, select_for_update=False, asides=None, read_only=False): + def __init__(self, descriptors, course_id, user, asides=None, read_only=False): """ Find any courseware.models objects that are needed by any descriptor in descriptors. Attempts to minimize the number of queries to the database. @@ -698,7 +698,6 @@ class FieldDataCache(object): descriptors: A list of XModuleDescriptors. course_id: The id of the current course user: The user for which to cache data - select_for_update: Ignored asides: The list of aside types to load, or None to prefetch no asides. read_only: We should not perform writes (they become a no-op). """ @@ -785,7 +784,7 @@ class FieldDataCache(object): @classmethod def cache_for_descriptor_descendents(cls, course_id, user, descriptor, depth=None, descriptor_filter=lambda descriptor: True, - select_for_update=False, asides=None, read_only=False): + asides=None, read_only=False): """ course_id: the course in the context of which we want StudentModules. user: the django user for whom to load modules. @@ -794,9 +793,8 @@ class FieldDataCache(object): the supplied descriptor. If depth is None, load all descendant StudentModules descriptor_filter is a function that accepts a descriptor and return whether the field data should be cached - select_for_update: Ignored """ - cache = FieldDataCache([], course_id, user, select_for_update, asides=asides, read_only=read_only) + cache = FieldDataCache([], course_id, user, asides=asides, read_only=read_only) cache.add_descriptor_descendents(descriptor, depth, descriptor_filter) return cache