Rework remove_label to return True if the operation succeeded

Signed-off-by: Christopher Obbard <chris@64studio.com>
pull/22/head
Christopher Obbard 2022-04-30 10:14:10 +01:00
parent 67935a5b0c
commit e1609f441e
1 changed files with 3 additions and 0 deletions

View File

@ -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