Skip to content

Commit

Permalink
fix: migrate board state notif job to board if deprecate
Browse files Browse the repository at this point in the history
  • Loading branch information
alexeyqu committed Jun 14, 2024
1 parent 51f8267 commit c331088
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/jobs/trello_board_state_notifications_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from ..strings import load
from ..tg.sender import TelegramSender, pretty_send
from ..trello.trello_objects import TrelloCard
from ..utils import card_checks
from ..utils import card_checks, card_checks_focalboard
from .base_job import BaseJob
from .utils import get_cards_by_curator, retrieve_usernames

Expand All @@ -21,15 +21,19 @@ def _execute(
):
sender = TelegramSender()

curator_cards = get_cards_by_curator(app_context)
curator_cards = get_cards_by_curator(app_context, app_context.trello_client.deprecated)
for curator, curator_cards in curator_cards.items():
curator_name, curator_tg = curator
card_paragraphs = []
curator_cards.sort(key=lambda c: c.due if c.due else datetime.datetime.min)
for card in curator_cards:
if app_context.trello_client.deprecated:
reasons = card_checks_focalboard.make_card_failure_reasons(card, app_context)
else:
reasons = card_checks.make_card_failure_reasons(card, app_context)
card_paragraph = TrelloBoardStateNotificationsJob._format_card(
card,
card_checks.make_card_failure_reasons(card, app_context),
reasons,
app_context,
)
if card_paragraph:
Expand Down

0 comments on commit c331088

Please sign in to comment.