Skip to content

Commit 012a26b

Browse files
authored
Fix extract_from_see_also() with None values (#223)
Fix condition in extract_from_see_also()
1 parent af6eb2e commit 012a26b

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

jbi/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ def issue_type(self) -> str:
277277

278278
def extract_from_see_also(self):
279279
"""Extract Jira Issue Key from see_also if jira url present"""
280-
if not self.see_also and len(self.see_also) > 0:
280+
if not self.see_also or len(self.see_also) == 0:
281281
return None
282282

283283
for url in self.see_also: # pylint: disable=not-an-iterable

jbi/runner.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ def execute_action(
2727
The value returned by the action call is returned.
2828
"""
2929
log_context = RunnerLogContext(
30-
bug=request.bug.dict(),
31-
request=request.dict(),
30+
bug=request.bug,
31+
request=request,
3232
operation=Operation.HANDLE,
3333
)
3434
try:

tests/unit/test_bugzilla.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ def test_jira_labels(whiteboard, expected):
3232
@pytest.mark.parametrize(
3333
"see_also,expected",
3434
[
35+
(None, None),
3536
([], None),
3637
(["foo"], None),
3738
(["fail:/format"], None),

0 commit comments

Comments
 (0)