22Customising Roundup
33===================
44
5- :Version: $Revision: 1.161.2.10 $
5+ :Version: $Revision: 1.161.2.11 $
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
@@ -3689,6 +3689,7 @@ resolved. To achieve this:
36893689
36903690 The contents of the detector should be something like this::
36913691
3692+
36923693 def blockresolution(db, cl, nodeid, newvalues):
36933694 ''' If the issue has blockers, don't allow it to be resolved.
36943695 '''
@@ -3719,18 +3720,21 @@ resolved. To achieve this:
37193720 if newvalues['status'] == resolved_id:
37203721 raise ValueError, "This issue can't be resolved until %s resolved."%s
37213722
3722- def resolveblockers(db, cl, nodeid, newvalues):
3723+
3724+ def resolveblockers(db, cl, nodeid, oldvalues):
37233725 ''' When we resolve an issue that's a blocker, remove it from the
37243726 blockers list of the issue(s) it blocks.
37253727 '''
3726- if not newvalues.has_key('status'):
3728+ newstatus = cl.get(nodeid,'status')
3729+
3730+ # no change?
3731+ if oldvalues.get('status', None) == newstatus:
37273732 return
37283733
3729- # get the resolved state ID
37303734 resolved_id = db.status.lookup('resolved')
37313735
37323736 # interesting?
3733- if newvalues['status'] != resolved_id:
3737+ if newstatus != resolved_id:
37343738 return
37353739
37363740 # yes - find all the blocked issues, if any, and remove me from
@@ -3742,7 +3746,6 @@ resolved. To achieve this:
37423746 blockers.remove(nodeid)
37433747 cl.set(issueid, blockers=blockers)
37443748
3745-
37463749 def init(db):
37473750 # might, in an obscure situation, happen in a create
37483751 db.issue.audit('create', blockresolution)
0 commit comments