Skip to content
This repository has been archived by the owner on Feb 25, 2018. It is now read-only.

Commit

Permalink
Stop removing/readding of next_action for future items.
Browse files Browse the repository at this point in the history
  • Loading branch information
nikdoof committed Sep 4, 2015
1 parent 54f770f commit 5554c63
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions nextaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,11 @@ def get_project_type(project_object):
if args.hide_future > 0 and 'due_date_utc' in item.data and item['due_date_utc'] is not None:
due_date = datetime.strptime(item['due_date_utc'], '%a %d %b %Y %H:%M:%S +0000')
future_diff = (due_date - datetime.utcnow()).total_seconds()
if future_diff >= (args.hide_future * 86400) and label_id in labels:
labels.remove(label_id)
logging.debug('Updating %s without label as its too far in the future', item['content'])
item.update(labels=labels)
if future_diff >= (args.hide_future * 86400):
if label_id in labels:
labels.remove(label_id)
logging.debug('Updating %s without label as its too far in the future', item['content'])
item.update(labels=labels)
continue

# Process item
Expand Down

0 comments on commit 5554c63

Please sign in to comment.