Rename ParticipationPoints table to EventPoints
build_develop / build (push) Successful in 1m21s

This commit is contained in:
2024-05-19 11:52:25 -04:00
parent 29a6b000ac
commit bec6494697
4 changed files with 18 additions and 22 deletions
+9 -9
View File
@@ -14,8 +14,8 @@ from sqlalchemy.orm import Session
from config import DakinyConfig
from database_setup.sql_data_classes import (
CouncilMembers,
EventPoints,
Messages,
ParticipationPoints,
Votes,
engine,
)
@@ -333,14 +333,14 @@ def record_event_participation(config: DakinyConfig, users: list[str], is_member
with Session(engine) as session:
for user in users:
stmt = (
select(ParticipationPoints)
.where(ParticipationPoints.UserId == user)
.where(ParticipationPoints.Cycle == cycle)
select(EventPoints)
.where(EventPoints.UserId == user)
.where(EventPoints.Cycle == cycle)
)
points = session.scalar(stmt)
if points is None:
new_points = ParticipationPoints(
new_points = EventPoints(
Cycle=cycle,
UserId=user,
DiscordMember=is_member,
@@ -366,14 +366,14 @@ def record_event_host(config: DakinyConfig, user: int):
host_point_value = config.params.event_host_points
with Session(engine) as session:
stmt = (
select(ParticipationPoints)
.where(ParticipationPoints.UserId == str(user))
.where(ParticipationPoints.Cycle == cycle)
select(EventPoints)
.where(EventPoints.UserId == str(user))
.where(EventPoints.Cycle == cycle)
)
points = session.scalar(stmt)
if points is None:
new_points = ParticipationPoints(
new_points = EventPoints(
Cycle=cycle,
UserId=str(user),
DiscordMember=True,