Skip to content

Commit 8fa76a4

Browse files
committed
Add pending -> open auditor; fix meta tag description
Open a pending ticket if message is added by anybody except the assignedto person. meta name=descripton was missing /> and was using magic quotes.
1 parent eb62623 commit 8fa76a4

File tree

2 files changed

+46
-1
lines changed

2 files changed

+46
-1
lines changed

website/issues/detectors/statusauditor.py

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,52 @@ def preset_new(db, cl, nodeid, newvalues):
77
new = db.status.lookup('new')
88
newvalues['status'] = new
99

10+
def update_pending(db, cl, nodeid, newvalues):
11+
''' If the issue is currently 'pending' and person other than assigned
12+
updates it, then set it to 'open'.
13+
'''
14+
# don't fire if there's no new message (ie. update)
15+
if 'messages' not in newvalues:
16+
return
17+
if newvalues['messages'] == cl.get(nodeid, 'messages'):
18+
return
19+
20+
# get the open state ID
21+
try:
22+
open_id = db.status.lookup('open')
23+
except KeyError:
24+
# no open state, ignore all this stuff
25+
return
26+
27+
# get the current value
28+
current_status = cl.get(nodeid, 'status')
29+
30+
# see if there's an explicit change in this transaction
31+
if 'status' in newvalues:
32+
# yep, skip
33+
return
34+
35+
assignee = cl.get(nodeid, 'assignee')
36+
if assignee == db.getuid():
37+
# this change is brought to you by the assignee and number 4
38+
# so don't change status.
39+
return
40+
41+
# determine the id of 'pending'
42+
fromstates = []
43+
for state in 'pending'.split():
44+
try:
45+
fromstates.append(db.status.lookup(state))
46+
except KeyError:
47+
pass
48+
49+
# ok, there's no explicit change, so check if we are in a state that
50+
# should be changed
51+
if current_status in fromstates + [None]:
52+
# yep, we're now open
53+
newvalues['status'] = open_id
1054

1155
def init(db):
1256
# fire before changes are made
1357
db.issue.audit('create', preset_new)
58+
db.issue.audit('set', update_pending)

website/issues/html/page.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
77
<title metal:define-slot="head_title">title goes here</title>
88
<link media="screen" href="@@file/defaultfonts.css" type="text/css" rel="alternate stylesheet" title="default fonts" />
9-
<meta name=description content=Issue tracker for the Roundup Issue Tracker software. Yes, we eat our own dog food.>
9+
<meta name="description" content="Issue tracker for the Roundup Issue Tracker software. Yes, we eat our own dog food." />
1010
<link rel="stylesheet" type="text/css" href="@@file/style.css" />
1111
<script tal:attributes="nonce request/client/client_nonce"
1212
tal:replace="structure request/base_javascript">

0 commit comments

Comments
 (0)