sarumont / py-trello

Python API wrapper around Trello's API
BSD 3-Clause "New" or "Revised" License
945 stars 330 forks source link

Fixed a problem with fetching checklists #328

Closed celedev97 closed 3 years ago

celedev97 commented 3 years ago

If you have a card with many checklist but no items inside them fetch_checklist cannot find any checklist.

The reason for that is that fetch_checklists does this:

if self.countCheckItems == 0:
    return []

and self.countCheckItems is created in this way:

card.countCheckItems = json_obj['badges']['checkItems']

So that means even if json_obj['idChecklists'] has many checklists that's not considered at all by fetch_checklists, therefore for every card with only empty checklists it's impossible to get those checklist and eventually edit their items.


I don't think it's intendend behaviour to have "phantoms" checklists that you can't find with py-trello but that the user can see, so i opened this PR.

The code seems to be working for me, tried with: