fix: 修复 Endpoint 获取错误问题

pull/12287/head
Bai 2023-12-08 16:16:15 +08:00 committed by Bryan
parent fb903e53a4
commit 2e3184cbd6
1 changed files with 2 additions and 2 deletions

View File

@ -81,10 +81,10 @@ class Endpoint(JMSBaseModel):
instance = instance.get_asset()
if not isinstance(instance, Asset):
return None
values = instance.labels.filter(name='endpoint').values_list('value', flat=True)
values = instance.labels.filter(label__name='endpoint').values_list('label__value', flat=True)
if not values:
return None
endpoints = cls.objects.filter(name__in=values).order_by('-date_updated')
endpoints = cls.objects.filter(name__in=list(values)).order_by('-date_updated')
for endpoint in endpoints:
if endpoint.is_valid_for(instance, protocol):
return endpoint