22Customising Roundup
33===================
44
5- :Version: $Revision: 1.174 $
5+ :Version: $Revision: 1.175 $
66
77.. This document borrows from the ZopeBook section on ZPT. The original is at:
88 http://www.zope.org/Documentation/Books/ZopeBook/current/ZPT.stx
@@ -3692,6 +3692,7 @@ resolved. To achieve this:
36923692
36933693 The contents of the detector should be something like this::
36943694
3695+
36953696 def blockresolution(db, cl, nodeid, newvalues):
36963697 ''' If the issue has blockers, don't allow it to be resolved.
36973698 '''
@@ -3722,18 +3723,21 @@ resolved. To achieve this:
37223723 if newvalues['status'] == resolved_id:
37233724 raise ValueError, "This issue can't be resolved until %s resolved."%s
37243725
3725- def resolveblockers(db, cl, nodeid, newvalues):
3726+
3727+ def resolveblockers(db, cl, nodeid, oldvalues):
37263728 ''' When we resolve an issue that's a blocker, remove it from the
37273729 blockers list of the issue(s) it blocks.
37283730 '''
3729- if not newvalues.has_key('status'):
3731+ newstatus = cl.get(nodeid,'status')
3732+
3733+ # no change?
3734+ if oldvalues.get('status', None) == newstatus:
37303735 return
37313736
3732- # get the resolved state ID
37333737 resolved_id = db.status.lookup('resolved')
37343738
37353739 # interesting?
3736- if newvalues['status'] != resolved_id:
3740+ if newstatus != resolved_id:
37373741 return
37383742
37393743 # yes - find all the blocked issues, if any, and remove me from
@@ -3745,7 +3749,6 @@ resolved. To achieve this:
37453749 blockers.remove(nodeid)
37463750 cl.set(issueid, blockers=blockers)
37473751
3748-
37493752 def init(db):
37503753 # might, in an obscure situation, happen in a create
37513754 db.issue.audit('create', blockresolution)
0 commit comments