diff --git a/openedx/core/djangoapps/bookmarks/serializers.py b/openedx/core/djangoapps/bookmarks/serializers.py index 37148cc6f2e4..67ca301b675a 100644 --- a/openedx/core/djangoapps/bookmarks/serializers.py +++ b/openedx/core/djangoapps/bookmarks/serializers.py @@ -51,7 +51,7 @@ def __init__(self, *args, **kwargs): # Drop any fields that are not specified in the `fields` argument. required_fields = set(fields) - if 'request' in kwargs['context'] and is_schema_request(kwargs['context']['request']): + if 'context' in kwargs and 'request' in kwargs['context'] and is_schema_request(kwargs['context']['request']): # We are serving the schema: include everything required_fields.update(OPTIONAL_FIELDS)