Mercurial > p > roundup > code
diff doc/customizing.txt @ 3258:1cbde34afa77
fix to doc
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Tue, 05 Apr 2005 01:06:54 +0000 |
| parents | 78d2f3ce85f6 |
| children | e41e1540a287 |
line wrap: on
line diff
--- a/doc/customizing.txt Mon Apr 04 08:47:14 2005 +0000 +++ b/doc/customizing.txt Tue Apr 05 01:06:54 2005 +0000 @@ -2,7 +2,7 @@ Customising Roundup =================== -:Version: $Revision: 1.174 $ +:Version: $Revision: 1.175 $ .. This document borrows from the ZopeBook section on ZPT. The original is at: http://www.zope.org/Documentation/Books/ZopeBook/current/ZPT.stx @@ -3692,6 +3692,7 @@ The contents of the detector should be something like this:: + def blockresolution(db, cl, nodeid, newvalues): ''' If the issue has blockers, don't allow it to be resolved. ''' @@ -3722,18 +3723,21 @@ if newvalues['status'] == resolved_id: raise ValueError, "This issue can't be resolved until %s resolved."%s - def resolveblockers(db, cl, nodeid, newvalues): + + def resolveblockers(db, cl, nodeid, oldvalues): ''' When we resolve an issue that's a blocker, remove it from the blockers list of the issue(s) it blocks. ''' - if not newvalues.has_key('status'): + newstatus = cl.get(nodeid,'status') + + # no change? + if oldvalues.get('status', None) == newstatus: return - # get the resolved state ID resolved_id = db.status.lookup('resolved') # interesting? - if newvalues['status'] != resolved_id: + if newstatus != resolved_id: return # yes - find all the blocked issues, if any, and remove me from @@ -3745,7 +3749,6 @@ blockers.remove(nodeid) cl.set(issueid, blockers=blockers) - def init(db): # might, in an obscure situation, happen in a create db.issue.audit('create', blockresolution)
