Browse Source

perf: Default endpoint cannot be disabled

pull/14272/head
wangruidong 1 month ago committed by Bryan
parent
commit
63f828da0b
  1. 7
      apps/terminal/serializers/endpoint.py

7
apps/terminal/serializers/endpoint.py

@ -58,6 +58,13 @@ class EndpointSerializer(BulkModelSerializer):
extra_kwargs[field.name] = kwargs
return extra_kwargs
def validate_is_active(self, value):
if str(self.instance.id) == Endpoint.default_id:
# 默认端点不能禁用
return True
else:
return value
class EndpointRuleSerializer(BulkModelSerializer):
_ip_group_help_text = '{}, {} <br>{}'.format(

Loading…
Cancel
Save