ReviewBot: always remove previous comment regardless of the state.

This commit is contained in:
Jimmy Berry 2017-04-25 13:36:46 -05:00
parent b4d00a4134
commit fdbe793585

View File

@ -412,6 +412,9 @@ class ReviewBot(object):
self.logger.debug('adding comment to {}: {}'.format(request.reqid, message))
if not self.dryrun:
if comment is None:
# Broaden search to include any comment state.
comment, _ = self.comment_api.comment_find(comments, self.bot_name)
if comment is not None:
self.comment_api.delete(comment['id'])
self.comment_api.add_comment(request_id=request.reqid, comment=str(message))