make tag handling more robust
If no tag is set, do not add anything. If None was accidentally included in the set of tags before, remove it now. If proposing the tags results in an error, log it and keep moving. Change-Id: Ic69f7b39f096d9c0a9cc5a2eb434a00048b88adc Signed-off-by: Doug Hellmann <doug@doughellmann.com>
This commit is contained in:
parent
78ce365758
commit
4fbf1078eb
@ -91,9 +91,16 @@ def _update_tags(sbc, story, tag):
|
||||
tags = set(story.tags or [])
|
||||
if tag in tags:
|
||||
return
|
||||
if not tag:
|
||||
return
|
||||
LOG.info('adding tag %s', tag)
|
||||
tags.add(tag)
|
||||
story.tags_manager.update(list(tags))
|
||||
if None in tags:
|
||||
tags.remove(None)
|
||||
try:
|
||||
story.tags_manager.update(list(tags))
|
||||
except Exception as err:
|
||||
LOG.info(err)
|
||||
|
||||
|
||||
def main():
|
||||
|
Loading…
x
Reference in New Issue
Block a user