You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When building the query filter with potential None values for name_prefix and user_id, the filter should be adjusted accordingly to avoid incorrect queries.
Expected Behavior:
If name_prefix is None, filter_dict should be empty ({}).
If user_id is None, it should not be added to the filter.
Actual Behavior:
Currently, if name_prefix is None, the filter becomes: filter_dict = {'task_original.name': {'$regex': '^None'}}
while in the case of None Type the filter_dict should be empty like filter_dict = {}
The actual issue is here:
name_prefix: str = str(kwargs.get("name_prefix"))
if name_prefix is not None:
filter_dict["task_original.name"] = {"$regex": f"^{name_prefix}"}
The text was updated successfully, but these errors were encountered:
Ayush5120
changed the title
fix: Handle None Values Correctly in Get Task Endpoint Query Filter
fix: Handle None Values Correctly in List Task Endpoint Query Filter
Jun 12, 2024
When building the query filter with potential None values for name_prefix and user_id, the filter should be adjusted accordingly to avoid incorrect queries.
Expected Behavior:
Actual Behavior:
Currently, if name_prefix is None, the filter becomes:
filter_dict = {'task_original.name': {'$regex': '^None'}}
while in the case of None Type the filter_dict should be empty like
filter_dict = {}
The actual issue is here:
and,
filter_dict["user_id"] = kwargs.get("user_id")
The text was updated successfully, but these errors were encountered: