summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: bf2b72d)
raw | patch | inline | side by side (parent: bf2b72d)
author | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Fri, 11 Oct 2002 01:26:05 +0000 (01:26 +0000) | ||
committer | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Fri, 11 Oct 2002 01:26:05 +0000 (01:26 +0000) |
- issues in 'done-cbb' are now also moved to 'chatting' on new messages
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@1342 57a73879-2fb5-44c3-a270-3262357dd7e2
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@1342 57a73879-2fb5-44c3-a270-3262357dd7e2
roundup/templates/classic/detectors/statusauditor.py | patch | blob | history |
diff --git a/roundup/templates/classic/detectors/statusauditor.py b/roundup/templates/classic/detectors/statusauditor.py
index 957100c6ee7c6bef3a59484a666780c5df7699c2..7b4a526acf22d98e8965f93ea621fca03744b4c5 100644 (file)
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
#
-#$Id: statusauditor.py,v 1.2 2002-09-10 01:07:06 richard Exp $
+#$Id: statusauditor.py,v 1.3 2002-10-11 01:26:05 richard Exp $
def chatty(db, cl, nodeid, newvalues):
- ''' If the issue is currently 'unread' or 'resolved', then set
+ ''' If the issue is currently 'unread', 'resolved' or 'done-cbb', then set
it to 'chatting'
'''
# don't fire if there's no new message (ie. chat)
if newvalues['messages'] == cl.get(nodeid, 'messages', cache=0):
return
- # determine the id of 'unread', 'resolved' and 'chatting'
- unread_id = db.status.lookup('unread')
- resolved_id = db.status.lookup('resolved')
- chatting_id = db.status.lookup('chatting')
+ # get the chatting state ID
+ try:
+ chatting_id = db.status.lookup('chatting')
+ except KeyError:
+ # no chatting state, ignore all this stuff
+ return
# get the current value
current_status = cl.get(nodeid, 'status')
# yep, skip
return
- # ok, there's no explicit change, so do it manually
- if current_status in (unread_id, resolved_id):
+ # determine the id of 'unread', 'resolved' and 'chatting'
+ fromstates = []
+ for state in 'unread resolved done-cbb'.split():
+ try:
+ fromstates.append(db.status.lookup(state))
+ except KeyError:
+ pass
+
+ # ok, there's no explicit change, so check if we are in a state that
+ # should be changed
+ if current_status in fromstates:
+ # yep, we're now chatting
newvalues['status'] = chatting_id
def presetunread(db, cl, nodeid, newvalues):
''' Make sure the status is set on new issues
'''
- if newvalues.has_key('status'):
+ if newvalues.has_key('status') and newvalues['status']:
return
# ok, do it