aboutsummaryrefslogtreecommitdiffstats
path: root/cfbe.py
diff options
context:
space:
mode:
authorSteve Losh <steve@stevelosh.com>2009-02-01 17:28:05 -0500
committerSteve Losh <steve@stevelosh.com>2009-02-01 17:28:05 -0500
commitf2e64e8c05e9255be619ae4ce47e9419088b5005 (patch)
tree80f4ded52cf32383af08f4e8a97f7fa2c1bc5983 /cfbe.py
parent55322caec86a2778fe973cb782043c3bc08fa988 (diff)
downloadbugseverywhere-f2e64e8c05e9255be619ae4ce47e9419088b5005.tar.gz
Got bug detail editing working, except for the summary.
Diffstat (limited to 'cfbe.py')
-rwxr-xr-xcfbe.py32
1 files changed, 28 insertions, 4 deletions
diff --git a/cfbe.py b/cfbe.py
index 0a8db77..9724fe7 100755
--- a/cfbe.py
+++ b/cfbe.py
@@ -23,19 +23,22 @@ class WebInterface:
self.repository_name = self.bd.root.split('/')[-1]
def get_common_information(self):
- possible_assignees = list(set([bug.assigned for bug in self.bd if bug.assigned != None]))
+ possible_assignees = list(set([bug.assigned for bug in self.bd if unicode(bug.assigned) != 'None']))
possible_assignees.sort(key=unicode.lower)
- possible_targets = list(set([bug.target for bug in self.bd if bug.target != None]))
+ possible_targets = list(set([bug.target for bug in self.bd if unicode(bug.target) != 'None']))
possible_targets.sort(key=unicode.lower)
possible_statuses = [u'open', u'assigned', u'test', u'unconfirmed',
- u'wishlist', u'closed', u'disabled', u'fixed',
- u'wontfix']
+ u'closed', u'disabled', u'fixed', u'wontfix']
+
+ possible_severities = [u'minor', u'serious', u'critical', u'fatal',
+ u'wishlist']
return {'possible_assignees': possible_assignees,
'possible_targets': possible_targets,
'possible_statuses': possible_statuses,
+ 'possible_severities': possible_severities,
'repository_name': self.repository_name,}
def filter_bugs(self, status, assignee, target):
@@ -77,6 +80,7 @@ class WebInterface:
assignees=common_info['possible_assignees'],
targets=common_info['possible_targets'],
statuses=common_info['possible_statuses'],
+ severities=common_info['possible_severities'],
repository_name=common_info['repository_name'])
@@ -94,6 +98,7 @@ class WebInterface:
assignees=common_info['possible_assignees'],
targets=common_info['possible_targets'],
statuses=common_info['possible_statuses'],
+ severities=common_info['possible_severities'],
repository_name=common_info['repository_name'])
@@ -117,7 +122,26 @@ class WebInterface:
raise cherrypy.HTTPRedirect('/bug?id=%s' % (shortname,), status=302)
+ @cherrypy.expose
+ def edit(self, id, status, target, assignee, severity, summary=''):
+ """The view that handles editing bug details."""
+ bug = self.bd.bug_from_uuid(id)
+ shortname = self.bd.bug_shortname(bug)
+
+ if summary.strip() != '':
+ bug.summary = summary
+ else:
+ bug.status = status if status != 'None' else None
+ bug.target = target if target != 'None' else None
+ bug.assigned = assignee if assignee != 'None' else None
+ bug.severity = severity if severity != 'None' else None
+
+ bug.save()
+
+ raise cherrypy.HTTPRedirect('/bug?id=%s' % (shortname,), status=302)
+
config = '/Users/sjl/Documents/cherryflavoredbugseverywhere/cfbe.config'
bug_root = '/Users/sjl/Desktop/be/.be'
+# bug_root = '/Users/sjl/Documents/cherryflavoredbugseverywhere/.be'
cherrypy.quickstart(WebInterface(bug_root), '/', config)