Skip to content

Commit

Permalink
Fixed linting error (Line greater than 160 characters).
Browse files Browse the repository at this point in the history
Updated unit test to reflect parameter changes in admin user search.
  • Loading branch information
felder101 committed Nov 1, 2023
1 parent a4ebede commit 4a54b4e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ describe('AdminAgencySelect', async () => {
linkElements[1].trigger('click')

expect(fetchSpy).toBeCalledTimes(2)
expect(fetchSpy.mock.lastCall[0].search).toBe('?name=Steeply&page_number=2')
expect(fetchSpy.mock.lastCall[0].search).toBe('?searchText=Steeply&page_number=2')
})

it('displays no results message', async () => {
Expand Down
3 changes: 2 additions & 1 deletion training/repositories/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ def get_users(self, searchText: str, page_number: int) -> UserSearchResult:
count = self._session.query(models.User).filter(or_(models.User.name.ilike(f"%{searchText}%"), models.User.email.ilike(f"%{searchText}%"))).count()
page_size = 25
offset = (page_number - 1) * page_size
search_results = self._session.query(models.User).filter(or_(models.User.name.ilike(f"%{searchText}%"), models.User.email.ilike(f"%{searchText}%"))).limit(page_size).offset(offset).all()
search_results = self._session.query(models.User).filter(
or_(models.User.name.ilike(f"%{searchText}%"), models.User.email.ilike(f"%{searchText}%"))).limit(page_size).offset(offset).all()
user_search_result = UserSearchResult(users=search_results, total_count=count)
return user_search_result

0 comments on commit 4a54b4e

Please sign in to comment.