diff --git a/common/lib/xmodule/xmodule/mongo_utils.py b/common/lib/xmodule/xmodule/mongo_utils.py index d46e129a8f..76f476bd43 100644 --- a/common/lib/xmodule/xmodule/mongo_utils.py +++ b/common/lib/xmodule/xmodule/mongo_utils.py @@ -48,6 +48,11 @@ def connect_to_mongodb( # If the MongoDB server uses a separate authentication database that should be specified here auth_source = kwargs.get('authsource', '') or None + # sanitize a kwarg which may be present and is no longer expected + # AED 2020-03-02 TODO: Remove this when 'auth_source' will no longer exist in kwargs + if 'auth_source' in kwargs: + kwargs.pop('auth_source') + # If read_preference is given as a name of a valid ReadPreference. # constant such as "SECONDARY_PREFERRED" or a mongo mode such as # "secondaryPreferred", convert it. Otherwise pass it through unchanged.