Skip to content

Commit

Permalink
fixed customFields on cards
Browse files Browse the repository at this point in the history
  • Loading branch information
Marc-Sefan Cassola committed Jun 5, 2018
1 parent 758d133 commit 9887c1b
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions trello/card.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from __future__ import with_statement, print_function, absolute_import

import datetime
from operator import itemgetter

import pytz
from dateutil import parser as dateparser
Expand Down Expand Up @@ -70,13 +71,13 @@ def list_labels(self):
return None

@property
def customFields(self):
def custom_fields(self):
"""
Lazily loads and returns the custom fields
"""
if self._customFields is None:
self._customFields = self.fetch_custom_fields()
return self._customFields
if self.customFields is None:
self.customFields = self.fetch_custom_fields()
return self.customFields

@property
def comments(self):
Expand Down Expand Up @@ -429,14 +430,7 @@ def get_stats_by_list(self, lists, list_cmp=None, done_list=None, time_unit="sec
# Changes in card are ordered to get the dates in order
last_list = None

def change_cmp(change1, change2):
if change1["datetime"] < change2["datetime"]:
return -1
if change1["datetime"] > change2["datetime"]:
return 1
return 0

ordered_changes = sorted(changes, cmp=change_cmp)
ordered_changes = sorted(changes, key=itemgetter("datetime"))
# For each arrival to a list, its datetime will be used to compute
# the time this card is in that destination list
for change in ordered_changes:
Expand Down

0 comments on commit 9887c1b

Please sign in to comment.