Skip to content

Commit

Permalink
Reorder which way we do the notifications. Slack first, lichess second.
Browse files Browse the repository at this point in the history
  • Loading branch information
lakinwecker committed Jan 15, 2024
1 parent 46e69fd commit 1d5fd89
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions heltour/tournament/notify.py
Original file line number Diff line number Diff line change
Expand Up @@ -522,13 +522,6 @@ def send_pairing_notification(type_, pairing, im_msg, mp_msg, li_subject, li_msg
}
black_params.update(common_params)

# Send lichess mails
if send_to_white and white_setting.enable_lichess_mail and li_subject and li_msg:
_lichess_message(league, white, li_subject.format(**white_params),
li_msg.format(**white_params))
if send_to_black and black_setting.enable_lichess_mail and li_subject and li_msg:
_lichess_message(league, black, li_subject.format(**black_params),
li_msg.format(**black_params))
# Send slack ims
if send_to_white and (
white_setting.enable_slack_im or white_setting.enable_slack_mpim) and not use_mpim and im_msg:
Expand All @@ -540,6 +533,14 @@ def send_pairing_notification(type_, pairing, im_msg, mp_msg, li_subject, li_msg
if send_to_white and use_mpim:
_message_multiple_users(league, [white, black], mp_msg.format(**common_params))

# Send lichess mails second.
if send_to_white and white_setting.enable_lichess_mail and li_subject and li_msg:
_lichess_message(league, white, li_subject.format(**white_params),
li_msg.format(**white_params))
if send_to_black and black_setting.enable_lichess_mail and li_subject and li_msg:
_lichess_message(league, black, li_subject.format(**black_params),
li_msg.format(**black_params))


@receiver(signals.notify_players_round_start, dispatch_uid='heltour.tournament.notify')
def notify_players_round_start(round_, **kwargs):
Expand Down

0 comments on commit 1d5fd89

Please sign in to comment.