Skip to content

Commit

Permalink
Merge pull request #49 from wafflestudio/modify_vote_list
Browse files Browse the repository at this point in the history
오타 수정, 튜플 에러 수정
  • Loading branch information
morecleverer authored Jan 30, 2025
2 parents 4d0dd9a + 09dc2e3 commit 3314a65
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions snuvote/app/vote/store.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def get_ongoing_list(self, start_cursor: tuple[datetime,int] |None) -> tuple[Lis

#커서가 none이면 가장 최신 것부터 self.pagination_size개
if start_cursor is None:
start_cursor = tuple(datetime.now(timezone.utc), 0)
start_cursor = (datetime.now(timezone.utc), 0)

# 생성 시간이 커서보다 최신인 것부터 오름차순(최신순)으로 self.pagination_size개 리턴
# 먼저 진행 중인 투표글의 Vote.id만 반환
Expand Down Expand Up @@ -134,7 +134,7 @@ def get_ended_votes_list(self, start_cursor: tuple[datetime,int] |None) -> tuple
select(Vote.id)
.where(Vote.end_datetime <= datetime.now(timezone.utc))
.where(
(Vote.end_datetime < start_cursor) # 종료시간이 커서 시간보다 과거이거나
(Vote.end_datetime < start_cursor[0]) # 종료시간이 커서 시간보다 과거이거나
| (
(Vote.end_datetime == start_cursor[0]) & (Vote.id > start_cursor[1]) # 종료시간이 커서와 같은데 id가 더 큰 경우
)
Expand Down Expand Up @@ -177,7 +177,7 @@ def get_hot_votes_list(self, start_cursor: tuple[datetime,int] |None) -> tuple[

#커서가 none이면 가장 최신 것부터 self.pagination_size개
if start_cursor is None:
start_cursor = tuple(datetime.now(timezone.utc), 0)
start_cursor = (datetime.now(timezone.utc), 0)


# 먼저 필요한 Vote만 필터링
Expand Down Expand Up @@ -230,7 +230,7 @@ def get_my_votes_list(self, user_id: int, start_cursor: tuple[datetime,int] |Non

#커서가 none이면 가장 최신 것부터 self.pagination_size개
if start_cursor is None:
start_cursor = tuple(datetime.now(timezone.utc), 0)
start_cursor = (datetime.now(timezone.utc), 0)


# 먼저 내가 만든 Vote만 필터링
Expand Down Expand Up @@ -283,7 +283,7 @@ def get_participated_votes_list(self, user_id: int, start_cursor: tuple[datetime

#커서가 none이면 가장 최신 것부터 self.pagination_size개
if start_cursor is None:
start_cursor = tuple(datetime.now(timezone.utc), 0)
start_cursor = (datetime.now(timezone.utc), 0)


# 먼저 내가 참여한 Vote만 필터링
Expand Down

0 comments on commit 3314a65

Please sign in to comment.