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:
@@ -234,6 +234,7 @@ def update_match(
|
||||
) -> s.MatchRead:
|
||||
match = match_service.get_match(session, match_id)
|
||||
match_service.assert_can_modify(session, match, user)
|
||||
rating_before = match_service.rating_inputs(session, match)
|
||||
match = match_service.update_match(
|
||||
session,
|
||||
match,
|
||||
@@ -257,7 +258,9 @@ def update_match(
|
||||
user_agent=request.headers.get("user-agent"),
|
||||
)
|
||||
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=match_service.can_modify(session, match, user))
|
||||
|
||||
|
||||
@@ -304,7 +307,7 @@ def add_attachment(
|
||||
att = attachment_service.add_photo(
|
||||
session, match, user, 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/matches/{match_id}")
|
||||
|
||||
|
||||
@@ -318,7 +321,7 @@ def delete_attachment(
|
||||
match = match_service.get_match(session, match_id)
|
||||
_assert_can_attach(session, match, user)
|
||||
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