[hop node] update peer validation logic (#14132)

This commit is contained in:
Jake Jackson 2023-06-15 14:45:23 -04:00 committed by Seth Foster
parent 8f8462b38e
commit 80df31fc4e

View File

@ -5491,7 +5491,7 @@ class InstanceSerializer(BaseSerializer):
if peers_from_control_nodes and node_type not in (Instance.Types.EXECUTION, Instance.Types.HOP):
raise serializers.ValidationError(_("peers_from_control_nodes can only be enabled for execution or hop nodes."))
if node_type in (Instance.Types.CONTROL):
if node_type == Instance.Types.CONTROL:
if self.instance and 'peers' in attrs and set(self.instance.peers.all()) != set(attrs['peers']):
raise serializers.ValidationError(
_("Setting peers manually for control nodes is not allowed. Enable peers_from_control_nodes on the hop and execution nodes instead.")