From a7dd002206c587c3d995cf5489ea42c6a2e873db Mon Sep 17 00:00:00 2001 From: Ehco1996 Date: Sun, 25 Aug 2024 20:47:20 +0800 Subject: [PATCH] chore: fix fake node sub --- apps/api/views.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/api/views.py b/apps/api/views.py index da0d832c5..86cde643d 100644 --- a/apps/api/views.py +++ b/apps/api/views.py @@ -10,6 +10,7 @@ from django.views import View from django.views.decorators.csrf import csrf_exempt from django.views.decorators.http import require_http_methods +from django.db.models.query import QuerySet from apps.ext import lock from apps.proxy import models as m @@ -99,7 +100,10 @@ def get(self, request): node_list = response_or_nodes if protocol := request.GET.get("protocol"): - if protocol in m.ProxyNode.NODE_TYPE_SET: + if ( + protocol in m.ProxyNode.NODE_TYPE_SET + and type(node_list) is QuerySet + ): node_list = node_list.filter(node_type=protocol) sub_client = request.GET.get("client")