From 66b2583e7d416188bee410cc7c6798f29e227a79 Mon Sep 17 00:00:00 2001 From: extreme4all <40169115+extreme4all@users.noreply.github.com> Date: Wed, 15 Nov 2023 20:58:07 +0100 Subject: [PATCH] remove feedback vote (#33) Co-authored-by: extreme4all <> --- src/app/models/player.py | 28 ++++++++++-------------- src/app/views/response/feedback_score.py | 1 - 2 files changed, 12 insertions(+), 17 deletions(-) diff --git a/src/app/models/player.py b/src/app/models/player.py index 15bca670..fb064e1c 100644 --- a/src/app/models/player.py +++ b/src/app/models/player.py @@ -63,29 +63,25 @@ async def get_report_score(self, player_names: tuple[str]): async def get_feedback_score(self, player_names: list[str]): # dbFeedback - feedback_voter: dbPlayer = aliased(dbPlayer, name="feedback_voter") - feedback_subject: dbPlayer = aliased(dbPlayer, name="feedback_subject") + fb_voter: dbPlayer = aliased(dbPlayer, name="feedback_voter") + fb_subject: dbPlayer = aliased(dbPlayer, name="feedback_subject") query: Select = select( [ - func.count(func.distinct(feedback_subject.id)).label("count"), - feedback_subject.possible_ban, - feedback_subject.confirmed_ban, - feedback_subject.confirmed_player, - dbFeedback.vote, + func.count(func.distinct(fb_subject.id)).label("count"), + fb_subject.possible_ban, + fb_subject.confirmed_ban, + fb_subject.confirmed_player, ] ) query = query.select_from(dbFeedback) - query = query.join(feedback_voter, dbFeedback.voter_id == feedback_voter.id) - query = query.join( - feedback_subject, dbFeedback.subject_id == feedback_subject.id - ) - query = query.where(feedback_voter.name.in_(player_names)) + query = query.join(fb_voter, dbFeedback.voter_id == fb_voter.id) + query = query.join(fb_subject, dbFeedback.subject_id == fb_subject.id) + query = query.where(fb_voter.name.in_(player_names)) query = query.group_by( - feedback_subject.possible_ban, - feedback_subject.confirmed_ban, - feedback_subject.confirmed_player, - dbFeedback.vote, + fb_subject.possible_ban, + fb_subject.confirmed_ban, + fb_subject.confirmed_player, ) async with self.session: diff --git a/src/app/views/response/feedback_score.py b/src/app/views/response/feedback_score.py index 48d7f685..0107c64b 100644 --- a/src/app/views/response/feedback_score.py +++ b/src/app/views/response/feedback_score.py @@ -6,4 +6,3 @@ class FeedbackScoreResponse(BaseModel): possible_ban: bool confirmed_ban: bool confirmed_player: bool - vote: int