Skip to content

Commit

Permalink
Merge branch 'refs/heads/develop' into bugfix_ticket
Browse files Browse the repository at this point in the history
  • Loading branch information
benero committed Sep 30, 2024
2 parents 5910a54 + 4f651ab commit 1647cb6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions itsm/auth_iam/resources/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,11 @@ def fetch_instance_info(self, filter, **options):

def search_instance(self, filter, page, **options):
"""
项目暂时不支持任何搜索
根据项目名称进行搜索,同时匹配 key 和 name 字段
"""
queryset = self.queryset.filter(key__contains=filter.keyword)
queryset = self.queryset.filter(
Q(name__icontains=filter.keyword) | Q(key__icontains=filter.keyword)
)
count = queryset.count()
results = [
{"id": project.key, "display_name": project.name}
Expand Down

0 comments on commit 1647cb6

Please sign in to comment.