Skip to content

Commit

Permalink
fix: Fix user active nodes filter
Browse files Browse the repository at this point in the history
  • Loading branch information
Ehco1996 committed Dec 21, 2023
1 parent 5414014 commit 51ba9d3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion apps/proxy/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ def get_active_nodes(cls):
def get_user_active_nodes(cls, user):
# 1. filter by user level
base_query = cls.get_active_nodes()
query = base_query.filter(level__gte=user.level)
query = base_query.filter(level__lte=user.level)
# 2. filter out nodes that has been occupied by other users
occupied_node_ids = UserProxyNodeOccupancy.get_occupied_node_ids()
query = query.exclude(id__in=occupied_node_ids)
Expand Down

0 comments on commit 51ba9d3

Please sign in to comment.