'See superclass doc.
In addition to the superclass\'s behavior, this method converts the unit to draft if it\'s not
direct-only and not already draft.'

def update_item(self, xblock, user_id, allow_not_found=False, force=False, isPublish=False, child_update=False, **kwargs):

    draft_loc = self.for_branch_setting(xblock.location)
    if (draft_loc.revision == MongoRevisionKey.published):
        item = super(DraftModuleStore, self).update_item(xblock, user_id, allow_not_found)
        course_key = xblock.location.course_key
        if (isPublish or ((item.category in DIRECT_ONLY_CATEGORIES) and (not child_update))):
            self._flag_publish_event(course_key)
        return item
    if (not super(DraftModuleStore, self).has_item(draft_loc)):
        try:
            self._convert_to_draft(xblock.location, user_id, ignore_if_draft=True)
        except ItemNotFoundError as exception:
            if (not (allow_not_found and (exception.args[0] == xblock.location))):
                raise
    xblock.location = draft_loc
    super(DraftModuleStore, self).update_item(xblock, user_id, allow_not_found, isPublish=isPublish)
    return wrap_draft(xblock)
