Skip to content

Commit

Permalink
Whoops
Browse files Browse the repository at this point in the history
  • Loading branch information
jotjern committed Mar 12, 2024
1 parent 615c565 commit cefc524
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion backend/app/db/punishments.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ async def get(
conn: Optional[Pool] = None,
) -> PunishmentRead:
async with MaybeAcquire(conn, self.db.pool) as conn:
query = """SELECT gp.*, CONCAT(COALESCE(NULLIF(users.first_name, ''), users.email)), ' ', users.last_name) AS created_by_name, COALESCE(json_agg(pr) FILTER (WHERE pr.punishment_reaction_id IS NOT NULL), '[]') as reactions FROM group_punishments gp
query = """SELECT gp.*, CONCAT(COALESCE(NULLIF(users.first_name, ''), users.email), ' ', users.last_name) AS created_by_name, COALESCE(json_agg(pr) FILTER (WHERE pr.punishment_reaction_id IS NOT NULL), '[]') as reactions FROM group_punishments gp
LEFT JOIN punishment_reactions pr ON pr.punishment_id = gp.punishment_id
LEFT JOIN users ON gp.created_by = users.user_id
WHERE gp.punishment_id = $1
Expand Down

0 comments on commit cefc524

Please sign in to comment.