Revert "Rename ParticipationPoints table to EventPoints"
This reverts commit bec6494697.
This commit is contained in:
@@ -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(EventPoints)
|
||||
.where(EventPoints.UserId == user)
|
||||
.where(EventPoints.Cycle == cycle)
|
||||
select(ParticipationPoints)
|
||||
.where(ParticipationPoints.UserId == user)
|
||||
.where(ParticipationPoints.Cycle == cycle)
|
||||
)
|
||||
|
||||
points = session.scalar(stmt)
|
||||
if points is None:
|
||||
new_points = EventPoints(
|
||||
new_points = ParticipationPoints(
|
||||
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(EventPoints)
|
||||
.where(EventPoints.UserId == str(user))
|
||||
.where(EventPoints.Cycle == cycle)
|
||||
select(ParticipationPoints)
|
||||
.where(ParticipationPoints.UserId == str(user))
|
||||
.where(ParticipationPoints.Cycle == cycle)
|
||||
)
|
||||
|
||||
points = session.scalar(stmt)
|
||||
if points is None:
|
||||
new_points = EventPoints(
|
||||
new_points = ParticipationPoints(
|
||||
Cycle=cycle,
|
||||
UserId=str(user),
|
||||
DiscordMember=True,
|
||||
|
||||
Reference in New Issue
Block a user