@classmethod
    def _validate_default_flag(self, data):
        nodegroup = objects.NodeGroupCollection.filter_by(
            None, name=data['name'], cluster_id=data['cluster_id']).first()
        if nodegroup and data['is_default'] != nodegroup.is_default:
                raise errors.NotAllowed(
                    "'default' flag for node group cannot be changed"
                )
Vadidate default flag
dataset/ETHPy150Open openstack/fuel-web/nailgun/nailgun/api/v1/validators/node_group.py/NodeGroupValidator._validate_default_flag