handle course_id being None
(possible in case of an error where course_id was not captured)
For lms-djangoapps
For base-keys
Merge remote-tracking branches 'edx/opaque-keys-base-keys', 'edx/opaque-keys-cms', 'edx/opaque-keys-common-djangoapps', 'edx/opaque-keys-common-lib-xmodule', 'edx/opaque-keys-common-misc', 'edx/opaque-keys-django-fields', 'edx/opaque-keys-embargo-tests', 'edx/opaque-keys-library', 'edx/opaque-keys-lms-courseware', 'edx/opaque-keys-lms-djangoapps', 'edx/opaque-keys-lms-templates', 'edx/opaque-keys-mongoengine-fields', 'edx/opaque-keys-requirements' and 'edx/opaque-keys-roles-table' into opaque-keys