diff options
author | Steve Losh <steve@stevelosh.com> | 2009-02-01 15:45:52 -0500 |
---|---|---|
committer | Steve Losh <steve@stevelosh.com> | 2009-02-01 15:45:52 -0500 |
commit | 59c742611d77ce59414d073e98782014dfb70d8f (patch) | |
tree | f906b233d103cf54d15b425626f0eef2dc61bcfe /cfbe.py | |
parent | b11274dde06473582f3f6ecb87c034d57d3917f4 (diff) | |
download | bugseverywhere-59c742611d77ce59414d073e98782014dfb70d8f.tar.gz |
Implemented bug adding.
Diffstat (limited to 'cfbe.py')
-rwxr-xr-x | cfbe.py | 17 |
1 files changed, 15 insertions, 2 deletions
@@ -29,8 +29,13 @@ class WebInterface: possible_targets = list(set([bug.target for bug in self.bd if 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'] + return {'possible_assignees': possible_assignees, 'possible_targets': possible_targets, + 'possible_statuses': possible_statuses, 'repository_name': self.repository_name,} def filter_bugs(self, status, assignee, target): @@ -70,6 +75,7 @@ class WebInterface: return template.render(bugs=bugs, bd=self.bd, label=label, assignees=common_info['possible_assignees'], targets=common_info['possible_targets'], + statuses=common_info['possible_statuses'], repository_name=common_info['repository_name']) @cherrypy.expose @@ -85,9 +91,16 @@ class WebInterface: return template.render(bug=bug, bd=self.bd, assignees=common_info['possible_assignees'], targets=common_info['possible_targets'], + statuses=common_info['possible_statuses'], repository_name=common_info['repository_name']) - + + @cherrypy.expose + def create(self, summary): + """The view that handles the creation of a new bug.""" + if summary.strip() != '': + self.bd.new_bug(summary=summary).save() + raise cherrypy.HTTPRedirect('/', status=302) config = '/Users/sjl/Documents/cherryflavoredbugseverywhere/cfbe.config' -bug_root = '/Users/sjl/Documents/cherryflavoredbugseverywhere/.be' +bug_root = '/Users/sjl/Desktop/be/.be' cherrypy.quickstart(WebInterface(bug_root), '/', config) |