Skip to content

Commit

Permalink
fix: migrate get_trello_board_state if deprecated
Browse files Browse the repository at this point in the history
  • Loading branch information
alexeyqu committed Jun 14, 2024
1 parent c752722 commit 0e4caeb
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/jobs/trello_board_state_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 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 @@ -22,15 +22,19 @@ def _execute(
paragraphs = [
load("trello_board_state_job__intro")
] # list of paragraph strings
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
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 = TrelloBoardStateJob._format_card(
card,
card_checks.make_card_failure_reasons(card, app_context),
reasons,
app_context,
)
if card_paragraph:
Expand Down

0 comments on commit 0e4caeb

Please sign in to comment.