'Update the persisted version of the given definition and return the
locator of the new definition. Does not check if data differs from the
previous version.'

def _update_definition_from_data(self, course_key, old_definition, new_def_data, user_id):

    new_definition = copy.deepcopy(old_definition)
    new_definition['_id'] = ObjectId()
    new_definition['fields'] = new_def_data
    new_definition['edit_info']['edited_by'] = user_id
    new_definition['edit_info']['edited_on'] = datetime.datetime.now(UTC)
    new_definition['edit_info']['previous_version'] = old_definition['_id']
    new_definition['schema_version'] = self.SCHEMA_VERSION
    self.update_definition(course_key, new_definition)
    return DefinitionLocator(new_definition['block_type'], new_definition['_id'])
