Skip to content

Conversation

shaohuzhang1
Copy link
Contributor

fix: Chat log search

Copy link

f2c-ci-robot bot commented Aug 27, 2025

Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

Copy link

f2c-ci-robot bot commented Aug 27, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@@ -101,7 +101,7 @@ def get_query_set(self, select_ids=None):
if 'abstract' in self.data and self.data.get('abstract') is not None:
base_query_dict['application_chat.abstract__icontains'] = self.data.get('abstract')
if 'username' in self.data and self.data.get('username') is not None:
base_query_dict['application_chat.asker__username'] = self.data.get('username')
base_query_dict['application_chat.asker__username__icontains'] = self.data.get('username')


if select_ids is not None and len(select_ids) > 0:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, there are no irregularities or potential issues with the code provided. The only change to note is that asker__username should be converted to asker__username__icontains. This ensures that all usernames starting with the given username query will match when using an ICONTAINS lookup, which allows partial text matches.

The changes:

             # Old line (without iexact)
-            base_query_dict['application_chat.asker__username'] = self.data.get('username')

             # New line with iexact
+            base_query_dict['application_chat.asker__username__icontains'] = self.data.get('username')

This makes sure the filter works as expected for both exact and partial matches of the username field.

@zhanweizhang7 zhanweizhang7 merged commit 675e90d into v2 Aug 27, 2025
3 of 5 checks passed
@zhanweizhang7 zhanweizhang7 deleted the pr@v2@fix_chat_log_search branch August 27, 2025 03:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants