Skip to content

Commit 9e9d39b

Browse files
crazyscientistcrobinso
authored andcommitted
Allow bug creation with an explicitly empty list of groups (closes #210)
This allows the caller of this method to create a bug with no groups assigned, even if server-side default group assignments are configured.
1 parent c2b4fed commit 9e9d39b

2 files changed

Lines changed: 21 additions & 1 deletion

File tree

bugzilla/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1761,7 +1761,7 @@ def build_createbug(self,
17611761
localdict["cc"] = listify(cc)
17621762
if depends_on:
17631763
localdict["depends_on"] = listify(depends_on)
1764-
if groups:
1764+
if groups is not None:
17651765
localdict["groups"] = listify(groups)
17661766
if keywords:
17671767
localdict["keywords"] = listify(keywords)

tests/test_base.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
from bugzilla.base import Bugzilla
2+
3+
4+
def test_build_createbug():
5+
bz = Bugzilla(url=None)
6+
7+
args = {"product": "Ubuntu 33⅓", "summary": "Hello World", "alias": "CVE-2024-0000"}
8+
result = bz.build_createbug(**args)
9+
assert result == args
10+
11+
result = bz.build_createbug(groups=None, **args)
12+
assert result == args
13+
14+
args["groups"] = []
15+
result = bz.build_createbug(**args)
16+
assert result == args
17+
18+
args["groups"] += ["the-group"]
19+
result = bz.build_createbug(**args)
20+
assert result == args

0 commit comments

Comments
 (0)