Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions src/focalboard/focalboard_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,9 @@ def get_custom_fields(self, card_id: str) -> objects.CardCustomFields:
if type_id == board_label_id:
card_labels_ids = value

if isinstance(card_labels_ids, str):
card_labels_ids = [card_labels_ids]

for card_label_id in card_labels_ids:
for board_label in board_labels:
if card_label_id == board_label.id:
Expand Down Expand Up @@ -366,7 +369,10 @@ def get_cards(self, list_ids=None, board_id=None):
card = objects.TrelloCard.from_focalboard_dict(card_dict)
card.url = urljoin(self.url, f"{board_id}/{view_id}/{card.id}")
card.labels = []
for label_id in card._fields_properties.get(label_prop, []):
raw_labels = card._fields_properties.get(label_prop, [])
if isinstance(raw_labels, str):
raw_labels = [raw_labels]
for label_id in raw_labels:
for label in labels:
if label.id == label_id:
card.labels.append(label)
Expand All @@ -388,9 +394,11 @@ def get_cards(self, list_ids=None, board_id=None):
f"List name not found for {card}: {card._fields_properties.get(list_prop, '')}"
)
# TODO: move this to app state
member_ids = card._fields_properties.get(member_prop, [])
if len(member_ids) > 0:
for member_id in member_ids:
raw_members = card._fields_properties.get(member_prop, [])
if isinstance(raw_members, str):
raw_members = [raw_members]
if len(raw_members) > 0:
for member_id in raw_members:
# check if member is in board members
matched_member = next(
(m for m in members if m.id == member_id), None
Expand Down
Loading