diff options
author | Chris Ball <cjb@laptop.org> | 2010-09-06 19:04:19 -0400 |
---|---|---|
committer | Chris Ball <cjb@laptop.org> | 2010-09-07 11:00:57 -0400 |
commit | fe99ef2f6148790ef792ecf47ca3629a4d367890 (patch) | |
tree | 79e2d0459498cca2cc7d0b065a6d54adfafe0606 /interfaces | |
parent | d542ab20d7fbb1c98d8fb7b03da37b6e211987d8 (diff) | |
download | bugseverywhere-fe99ef2f6148790ef792ecf47ca3629a4d367890.tar.gz |
cfbe: API: fix editing a bug's target
Diffstat (limited to 'interfaces')
-rw-r--r-- | interfaces/web/web.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/interfaces/web/web.py b/interfaces/web/web.py index 44bdef1..a99758c 100644 --- a/interfaces/web/web.py +++ b/interfaces/web/web.py @@ -7,6 +7,7 @@ import cherrypy from libbe import storage from libbe import bugdir from libbe.command.depend import get_blocked_by, get_blocks +from libbe.command.target import add_target, remove_target from libbe.command.target import bug_from_target_summary, bug_target from libbe.command.util import bug_comment_from_user_id from libbe.storage.util import settings_object @@ -180,10 +181,18 @@ class WebInterface: 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 + if target: + current_target = bug_target(self.bd, bug) + if current_target: + remove_target(self.bd, bug) + if target != "None": + add_target(self.bd, bug, target) + else: + add_target(self.bd, bug, target) + bug.save() raise cherrypy.HTTPRedirect( |