mirror of https://github.com/Hoffelhas/autodoist
Rework remove_label to return True if the operation succeeded
Signed-off-by: Christopher Obbard <chris@64studio.com>pull/22/head
parent
67935a5b0c
commit
e1609f441e
|
@ -336,6 +336,7 @@ def add_label(item, label, overview_item_ids, overview_item_labels):
|
|||
# Logic to remove a label from an item
|
||||
|
||||
|
||||
# returns True if the label was removed; False otherwise
|
||||
def remove_label(item, label, overview_item_ids, overview_item_labels):
|
||||
if label in item['labels']:
|
||||
labels = item['labels']
|
||||
|
@ -347,6 +348,8 @@ def remove_label(item, label, overview_item_ids, overview_item_labels):
|
|||
except:
|
||||
overview_item_ids[str(item['id'])] = -1
|
||||
overview_item_labels[str(item['id'])] = labels
|
||||
return True
|
||||
return False
|
||||
|
||||
# Ensure labels are only issued once per item
|
||||
|
||||
|
|
Loading…
Reference in New Issue