Skip to content

Commit

Permalink
Fix search for one page result
Browse files Browse the repository at this point in the history
  • Loading branch information
felipeall committed Sep 1, 2023
1 parent 43a9383 commit 82b7f64
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
8 changes: 4 additions & 4 deletions app/services/clubs/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ def _get_last_page_number(self) -> int:
url_page_number_active: list = self.page.xpath(Clubs.Search.PAGE_NUMBER_ACTIVE)

if url_page_number_last:
last_page_number = int(url_page_number_last[0].split("=")[-1])
return int(url_page_number_last[0].split("=")[-1])
elif url_page_number_active:
return int(url_page_number_active[0].split("=")[-1])
else:
last_page_number = int(url_page_number_active[0].split("=")[-1])

return last_page_number
return 1
8 changes: 4 additions & 4 deletions app/services/competitions/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ def _get_last_page_number(self) -> int:
url_page_number_active: list = self.page.xpath(Competitions.Search.PAGE_NUMBER_ACTIVE)

if url_page_number_last:
last_page_number = int(url_page_number_last[0].split("=")[-1])
return int(url_page_number_last[0].split("=")[-1])
elif url_page_number_active:
return int(url_page_number_active[0].split("=")[-1])
else:
last_page_number = int(url_page_number_active[0].split("=")[-1])

return last_page_number
return 1
8 changes: 4 additions & 4 deletions app/services/players/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ def _get_last_page_number(self) -> int:
url_page_number_active: list = self.page.xpath(Players.Search.PAGE_NUMBER_ACTIVE)

if url_page_number_last:
last_page_number = int(url_page_number_last[0].split("=")[-1])
return int(url_page_number_last[0].split("=")[-1])
elif url_page_number_active:
return int(url_page_number_active[0].split("=")[-1])
else:
last_page_number = int(url_page_number_active[0].split("=")[-1])

return last_page_number
return 1

0 comments on commit 82b7f64

Please sign in to comment.