[Python-checkins] r54388 - in tracker/instances/python-dev: detectors/severityauditor.py html/issue.item.html

erik.forsberg python-checkins at python.org
Wed Mar 14 22:00:04 CET 2007


Author: erik.forsberg
Date: Wed Mar 14 22:00:01 2007
New Revision: 54388

Added:
   tracker/instances/python-dev/detectors/severityauditor.py
Modified:
   tracker/instances/python-dev/html/issue.item.html
Log:

Set severity to normal if not explicitly set by submitter. In web
interface, do this by preselecting the normal status. Also add auditor
that will set status on issues created via mail.

Fixes http://psf.upfronthosting.co.za/roundup/meta/issue93.


Added: tracker/instances/python-dev/detectors/severityauditor.py
==============================================================================
--- (empty file)
+++ tracker/instances/python-dev/detectors/severityauditor.py	Wed Mar 14 22:00:01 2007
@@ -0,0 +1,11 @@
+
+def init_severity(db, cl, nodeid, newvalues):
+    """Make sure severity is set on new issues"""
+    if newvalues.has_key('severity') and newvalues['severity']:
+        return
+
+    normal = db.severity.lookup('normal')
+    newvalues['severity'] = normal
+
+def init(db):
+    db.issue.audit('create', init_severity)

Modified: tracker/instances/python-dev/html/issue.item.html
==============================================================================
--- tracker/instances/python-dev/html/issue.item.html	(original)
+++ tracker/instances/python-dev/html/issue.item.html	Wed Mar 14 22:00:01 2007
@@ -58,7 +58,14 @@
  <th i18n:translate="">
    <span tal:replace="structure python:db.severity.classhelp('id,name,description',label='Severity')" />:
  </th>
- <td tal:content="structure context/severity/menu">severity</td>
+<!-- Set severity to normal per default -->
+<td tal:condition="not: context/severity"
+     tal:content="structure
+     python:context.severity.menu(value=db.severity.filter(filterspec={'name':'normal'})[0].id)">severity></td>
+
+ <td tal:condition="context/severity"
+     tal:content="structure context/severity/menu">severity</td>
+
 </tr>
 
 <tr>


More information about the Python-checkins mailing list