Skip to content

Commit

Permalink
Merge pull request #2220 from shuhaib-aot/bugfix/Search-remove-empty-…
Browse files Browse the repository at this point in the history
…space

Removed empty space from for search
  • Loading branch information
arun-s-aot authored Sep 5, 2024
2 parents d6eb878 + 9f24291 commit 17563ce
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -223,15 +223,16 @@ def find_all_forms(
is_active=None,
form_type=None,
search=None,
**filters,
): # pylint: disable=too-many-arguments
"""Fetch all active and inactive forms which are not deleted."""
# Get latest row for each form_id group
filtered_form_query = cls.get_latest_form_mapper_ids()
filtered_form_ids = [
data.id for data in filtered_form_query if data.parent_form_id in form_ids
]

query = cls.query.filter(
query = cls.filter_conditions(**filters)
query = query.filter(
and_(FormProcessMapper.deleted.is_(False)),
FormProcessMapper.id.in_(filtered_form_ids),
)
Expand Down Expand Up @@ -276,14 +277,16 @@ def find_all_active_by_formid(
sort_order=None,
search=None,
form_ids=None,
**filters,
): # pylint: disable=too-many-arguments
"""Fetch all active form process mappers by authorized forms."""
# Get latest row for each form_id group
filtered_form_query = cls.get_latest_form_mapper_ids()
filtered_form_ids = [
data.id for data in filtered_form_query if data.parent_form_id in form_ids
]
query = cls.query.filter(
query = cls.filter_conditions(**filters)
query = query.filter(
FormProcessMapper.id.in_(filtered_form_ids),
)
query = cls.add_search_filter(query=query, search=search)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ def get(): # pylint: disable=too-many-locals
form_type = form_type.split(",")
if search:
search = search.replace("%", r"\%").replace("_", r"\_")
search = search.split(" ")
search = [key for key in search.split(" ") if key.strip()]

(
form_process_mapper_schema,
Expand Down

0 comments on commit 17563ce

Please sign in to comment.