Skip to content

Commit c5a6226

Browse files
committed
script/backport-create-issue: handle ResourceAttrError when getting CF_TAGS
Older versions of python-redmine may raise ResourceAttrError here instead of returning None, see [1]. Being prepared for an exception seems like a good idea regardless given how this field recently got recreated. [1] maxtepkeev/python-redmine@0de5689 Signed-off-by: Ilya Dryomov <[email protected]>
1 parent 3956c42 commit c5a6226

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/script/backport-create-issue

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -319,11 +319,13 @@ def mark_as_processed(r, issue):
319319
logging.debug("custom_fields: %s", list(issue['custom_fields']))
320320

321321
tags_cf = next(filter(lambda x: x['id'] == CF_TAGS, issue['custom_fields']), None)
322-
323322
if tags_cf is None:
324323
tags = ''
325324
else:
326-
tags = tags_cf.value
325+
try:
326+
tags = tags_cf.value
327+
except ResourceAttrError:
328+
tags = None
327329
if tags is None:
328330
tags = ''
329331
else:

0 commit comments

Comments
 (0)