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")