summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: abcbbc4)
raw | patch | inline | side by side (parent: abcbbc4)
author | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Wed, 7 Apr 2004 06:31:47 +0000 (06:31 +0000) | ||
committer | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Wed, 7 Apr 2004 06:31:47 +0000 (06:31 +0000) |
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@2264 57a73879-2fb5-44c3-a270-3262357dd7e2
CHANGES.txt | patch | blob | history | |
detectors/creator_resolution.py | [new file with mode: 0644] | patch | blob |
doc/customizing.txt | patch | blob | history |
diff --git a/CHANGES.txt b/CHANGES.txt
index 0e8da9509e156a98465071e42fe5bd3c92b6f9cc..f718a390432ae02e448b88d98987e4db77854a60 100644 (file)
--- a/CHANGES.txt
+++ b/CHANGES.txt
- database export now exports full journals too
- tracker name at end of page title (sf rfe 926840)
- roundup-server now uses the ForkingMixin
+- added another sample detector "creator_resolution"
Fixed:
- web CSV export was busted (as was any action returning a result)
diff --git a/detectors/creator_resolution.py b/detectors/creator_resolution.py
--- /dev/null
@@ -0,0 +1,40 @@
+#$Id: creator_resolution.py,v 1.1 2004-04-07 06:31:47 richard Exp $
+
+from roundup.exceptions import Reject
+
+def creator_resolution(db, cl, nodeid, newvalues):
+ '''Catch attempts to set the status to "resolved" - if the assignedto
+ user isn't the creator, then set the status to "in-progress" (try
+ "confirm-done" first though, but "classic" Roundup doesn't have that
+ status)
+ '''
+ if not newvalues.has_key('status'):
+ return
+
+ # get the resolved state ID
+ resolved_id = db.status.lookup('resolved')
+
+ if newvalues['status'] != resolved_id:
+ return
+
+ # check the assignedto
+ assignedto = newvalues.get('assignedto', cl.get(nodeid, 'assignedto'))
+ creator = cl.get(nodeid, 'creator')
+ if assignedto == creator:
+ if db.getuid() != creator:
+ name = db.user.get(creator, 'username')
+ raise Reject, 'Only the creator (%s) may close this issue'%name
+ return
+
+ # set the assignedto and status
+ newvalues['assignedto'] = creator
+ try:
+ status = db.status.lookup('confirm-done')
+ except KeyError:
+ status = db.status.lookup('in-progress')
+ newvalues['status'] = status
+
+def init(db):
+ db.issue.audit('set', creator_resolution)
+
+# vim: set filetype=python ts=4 sw=4 et si
diff --git a/doc/customizing.txt b/doc/customizing.txt
index 243eb0335ffdabce601a7231826244bd6a96df2f..ddcd33ea6edf65df6d13d654fcdf924c41e65f1e 100644 (file)
--- a/doc/customizing.txt
+++ b/doc/customizing.txt
Customising Roundup
===================
-:Version: $Revision: 1.132 $
+:Version: $Revision: 1.133 $
.. This document borrows from the ZopeBook section on ZPT. The original is at:
http://www.zope.org/Documentation/Books/ZopeBook/current/ZPT.stx
__ design.html
+Additional Detectors Ready For Use
+----------------------------------
+
Sample additional detectors that have been found useful will appear in
the ``'detectors'`` directory of the Roundup distribution. If you want
to use one, copy it to the ``'detectors'`` of your tracker instance:
created. The address is hard-coded into the detector, so edit it
before you use it (look for the text 'team@team.host') or you'll get
email errors!
-
- The detector code::
-
- from roundup import roundupdb
-
- def newissuecopy(db, cl, nodeid, oldvalues):
- ''' Copy a message about new issues to a team address.
- '''
- # so use all the messages in the create
- change_note = cl.generateCreateNote(nodeid)
-
- # send a copy to the nosy list
- for msgid in cl.get(nodeid, 'messages'):
- try:
- # note: last arg must be a list
- cl.send_message(nodeid, msgid, change_note,
- ['team@team.host'])
- except roundupdb.MessageSendError, message:
- raise roundupdb.DetectorError, message
-
- def init(db):
- db.issue.react('create', newissuecopy)
+**creator_resolution.py**
+ Catch attempts to set the status to "resolved" - if the assignedto
+ user isn't the creator, then set the status to "confirm-done". Note that
+ "classic" Roundup doesn't have that status, so you'll have to add it. If
+ you don't want to though, it'll just use "in-progress" instead.
+**email_auditor.py**
+ If a file added to an issue is of type message/rfc822, we tack on the
+ extension .eml.
+ The reason for this is that Microsoft Internet Explorer will not open
+ things with a .eml attachment, as they deem it 'unsafe'. Worse yet,
+ they'll just give you an incomprehensible error message. For more
+ information, see the detector code - it has a length explanation.
Auditor or Reactor?