Skip to content

Commit e6c6872

Browse files
committed
Fixed issue2550572: setting nosy=+foo on multiple issues gives them all
the same exact nosy list. Added a missing reinitialization that has to occur every time though the loop in do_set. Manually tested with: python roundup/scripts/roundup_admin.py -i demo set issue184,issue17 nosy=demo python roundup/scripts/roundup_admin.py -i demo set issue17 nosy=+alpha,+anonymous python roundup/scripts/roundup_admin.py -i demo set issue184 nosy=+beta,+anonymous python roundup/scripts/roundup_admin.py -i demo set issue184,issue17 nosy=-demo,-anonymous,+admin issue17 nosy was admin,alpha issue 184 nosy was admin,beta after tests.
1 parent f081640 commit e6c6872

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

CHANGES.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,10 @@ Fixed:
165165
Fix old entry in FAQ, update roundup-server config docs and
166166
example file from current roundup-server output. Update
167167
some typos in .py files. John Rouillard.
168+
- issue2550572: setting nosy=+foo on multiple issues gives them all
169+
the same exact nosy list. Fixed a missing reinitialization that has
170+
to occur every time though the loop in do_set. Manual tests work.
171+
(John Rouillard)
168172

169173
2016-01-11: 1.5.1
170174

roundup/admin.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -608,6 +608,8 @@ def do_set(self, args):
608608
is un-set. If the property is a multilink, you specify the linked
609609
ids for the multilink as comma-separated numbers (ie "1,2,3").
610610
"""
611+
import copy # needed for copying props list
612+
611613
if len(args) < 2:
612614
raise UsageError(_('Not enough arguments supplied'))
613615
from roundup import hyperdb
@@ -628,15 +630,21 @@ def do_set(self, args):
628630
raise UsageError(message)
629631

630632
# get the props from the args
631-
props = self.props_from_args(args[1:])
633+
propset = self.props_from_args(args[1:]) # parse the cli once
632634

633635
# now do the set for all the nodes
634636
for classname, itemid in designators:
637+
props = copy.copy(propset) # make a new copy for every designator
635638
cl = self.get_class(classname)
636639

637-
properties = cl.getprops()
638640
for key, value in props.items():
639641
try:
642+
# You must reinitialize the props every time though.
643+
# if props['nosy'] = '+admin' initally, it gets
644+
# set to 'demo,admin' (assuming it was set to demo
645+
# in the db) after rawToHyperdb returns.
646+
# This new value is used for all the rest of the
647+
# designators if not reinitalized.
640648
props[key] = hyperdb.rawToHyperdb(self.db, cl, itemid,
641649
key, value)
642650
except hyperdb.HyperdbValueError, message:

0 commit comments

Comments
 (0)