Rework point settings to combine clan and event points into same class for simplicity.
This commit is contained in:
@@ -309,7 +309,7 @@ def record_event_points(users: Sequence[str], add_points: int, *, is_member: boo
|
||||
|
||||
points = session.scalar(stmt)
|
||||
if points is None:
|
||||
add_points = get_allowed_points(session, settings.event_settings.weekly_limit, user, add_points)
|
||||
add_points = get_allowed_points(session, settings.point_settings.events_weekly_limit, user, add_points)
|
||||
new_points = EventPoints(
|
||||
QuarterName=quarter_name,
|
||||
UserId=user,
|
||||
@@ -318,7 +318,7 @@ def record_event_points(users: Sequence[str], add_points: int, *, is_member: boo
|
||||
)
|
||||
session.add(new_points)
|
||||
else:
|
||||
add_points = get_allowed_points(session, settings.event_settings.weekly_limit, user, add_points)
|
||||
add_points = get_allowed_points(session, settings.point_settings.events_weekly_limit, user, add_points)
|
||||
points.Points += add_points
|
||||
|
||||
session.commit()
|
||||
|
||||
Reference in New Issue
Block a user