Skip to content

Commit

Permalink
Merge pull request #6598 from hotosm/fastapi-refactor
Browse files Browse the repository at this point in the history
fix project teams patch
  • Loading branch information
prabinoid authored Oct 16, 2024
2 parents 27c4645 + 0dbad88 commit 093e0ed
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
2 changes: 1 addition & 1 deletion backend/models/postgis/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,7 @@ async def update(self, project_dto: ProjectDTO, db: Database):
self.teams = []
if hasattr(project_dto, "project_teams") and project_dto.project_teams:
for team_dto in project_dto.project_teams:
team = Team.get(team_dto.team_id)
team = Team.get(team_dto.team_id, db)

if team is None:
raise NotFound(sub_code="TEAM_NOT_FOUND", team_id=team_dto.team_id)
Expand Down
3 changes: 0 additions & 3 deletions backend/services/project_search_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -496,12 +496,9 @@ async def _filter_projects(search_dto: ProjectSearchDTO, user, db: Database):
# Get total count
count_query = f"SELECT COUNT(*) FROM ({sql_query}) AS count_subquery"
total_count = await db.fetch_val(count_query, values=params)
print(total_count, "THe total count...")
paginated_results = await db.fetch_all(sql_query_paginated, values=params)
all_results = await db.fetch_all(sql_query, values=params)
print(all_results, "All results...")
pagination_dto = Pagination.from_total_count(page, per_page, total_count)
print(pagination_dto, "Pagination dtooo...")
return all_results, paginated_results, pagination_dto

@staticmethod
Expand Down

0 comments on commit 093e0ed

Please sign in to comment.