SSE: не рассылать ratings на правки без влияния на рейтинг; событие group при смене настроек группы
- notify.match_changed получил флаг ratings: фото (игрок и админ) его не шлют, правка
партии — только если изменились входы рейтинга (match_service.rating_inputs до/после).
- PATCH /api/groups/{id} публикует group — переименование и правило 9 раундов видны
остальным участникам сразу.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -243,6 +243,7 @@ def update_match(
|
||||
admin: User = Depends(get_current_admin),
|
||||
) -> s.MatchRead:
|
||||
match = match_service.get_match(session, match_id)
|
||||
rating_before = match_service.rating_inputs(session, match)
|
||||
match = match_service.update_match(
|
||||
session,
|
||||
match,
|
||||
@@ -265,7 +266,9 @@ def update_match(
|
||||
ip=client_ip(request),
|
||||
)
|
||||
session.commit()
|
||||
notify.match_changed(session, match)
|
||||
notify.match_changed(
|
||||
session, match, ratings=match_service.rating_inputs(session, match) != rating_before
|
||||
)
|
||||
return build_match_read(session, match, can_modify=True)
|
||||
|
||||
|
||||
@@ -356,7 +359,7 @@ def admin_add_attachment(
|
||||
att = attachment_service.add_photo(
|
||||
session, match, admin, content, ext, user_service.avatar_media_type(ext)
|
||||
)
|
||||
notify.match_changed(session, match)
|
||||
notify.match_changed(session, match, ratings=False)
|
||||
return attachment_read(att, f"/api/admin/matches/{match_id}")
|
||||
|
||||
|
||||
@@ -369,7 +372,7 @@ def admin_delete_attachment(
|
||||
) -> s.OkResponse:
|
||||
match = match_service.get_match(session, match_id)
|
||||
attachment_service.delete(session, match, attachment_id)
|
||||
notify.match_changed(session, match)
|
||||
notify.match_changed(session, match, ratings=False)
|
||||
return s.OkResponse()
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user