From 790a33a51a6281535cae338c9f64a675bb6dc6b5 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Thu, 15 Jul 2010 06:38:56 -0400 Subject: [PATCH] Fixed #bea/206d9b07# : 'BugDir' object has no attribute 'bug_shortname' (cfbe) Tested with a single bug attribute change and comment addition. --- .../5bcce533-03bb-4b3a-ab77-92d32a7aa054/body | 4 +++ .../values | 8 ++++++ .../values | 2 +- interfaces/web/templates/list.html | 2 +- interfaces/web/web.py | 28 +++++++++++-------- 5 files changed, 31 insertions(+), 13 deletions(-) create mode 100644 .be/bea86499-824e-4e77-b085-2d581fa9ccab/bugs/206d9b07-6e30-4c8b-9594-ee98e3c646e7/comments/5bcce533-03bb-4b3a-ab77-92d32a7aa054/body create mode 100644 .be/bea86499-824e-4e77-b085-2d581fa9ccab/bugs/206d9b07-6e30-4c8b-9594-ee98e3c646e7/comments/5bcce533-03bb-4b3a-ab77-92d32a7aa054/values diff --git a/.be/bea86499-824e-4e77-b085-2d581fa9ccab/bugs/206d9b07-6e30-4c8b-9594-ee98e3c646e7/comments/5bcce533-03bb-4b3a-ab77-92d32a7aa054/body b/.be/bea86499-824e-4e77-b085-2d581fa9ccab/bugs/206d9b07-6e30-4c8b-9594-ee98e3c646e7/comments/5bcce533-03bb-4b3a-ab77-92d32a7aa054/body new file mode 100644 index 0000000..93d527b --- /dev/null +++ b/.be/bea86499-824e-4e77-b085-2d581fa9ccab/bugs/206d9b07-6e30-4c8b-9594-ee98e3c646e7/comments/5bcce533-03bb-4b3a-ab77-92d32a7aa054/body @@ -0,0 +1,4 @@ +Fixed by replacing + '/bug?id=%s' % shortname +with + '/bug?%s' % urlencode({'id':bug.id.long_user()}) diff --git a/.be/bea86499-824e-4e77-b085-2d581fa9ccab/bugs/206d9b07-6e30-4c8b-9594-ee98e3c646e7/comments/5bcce533-03bb-4b3a-ab77-92d32a7aa054/values b/.be/bea86499-824e-4e77-b085-2d581fa9ccab/bugs/206d9b07-6e30-4c8b-9594-ee98e3c646e7/comments/5bcce533-03bb-4b3a-ab77-92d32a7aa054/values new file mode 100644 index 0000000..ae252e1 --- /dev/null +++ b/.be/bea86499-824e-4e77-b085-2d581fa9ccab/bugs/206d9b07-6e30-4c8b-9594-ee98e3c646e7/comments/5bcce533-03bb-4b3a-ab77-92d32a7aa054/values @@ -0,0 +1,8 @@ +Author: W. Trevor King + + +Content-type: text/plain + + +Date: Thu, 15 Jul 2010 10:35:43 +0000 + diff --git a/.be/bea86499-824e-4e77-b085-2d581fa9ccab/bugs/206d9b07-6e30-4c8b-9594-ee98e3c646e7/values b/.be/bea86499-824e-4e77-b085-2d581fa9ccab/bugs/206d9b07-6e30-4c8b-9594-ee98e3c646e7/values index 959cc7a..f69d98d 100644 --- a/.be/bea86499-824e-4e77-b085-2d581fa9ccab/bugs/206d9b07-6e30-4c8b-9594-ee98e3c646e7/values +++ b/.be/bea86499-824e-4e77-b085-2d581fa9ccab/bugs/206d9b07-6e30-4c8b-9594-ee98e3c646e7/values @@ -7,7 +7,7 @@ reporter: gour severity: minor -status: open +status: fixed summary: '''BugDir'' object has no attribute ''bug_shortname'' (cfbe)' diff --git a/interfaces/web/templates/list.html b/interfaces/web/templates/list.html index 83007d3..216b731 100644 --- a/interfaces/web/templates/list.html +++ b/interfaces/web/templates/list.html @@ -16,7 +16,7 @@ {% for bug in bugs %} {{ bug.id.user() }} - + {{ bug.summary|e|truncate(70) }} {{ bug.status }} {{ bug.target }} diff --git a/interfaces/web/web.py b/interfaces/web/web.py index e80f676..75a430d 100644 --- a/interfaces/web/web.py +++ b/interfaces/web/web.py @@ -1,11 +1,15 @@ +from datetime import datetime +from urllib import urlencode + +from jinja2 import Environment, FileSystemLoader import cherrypy + from libbe import storage from libbe import bugdir from libbe.command.depend import get_blocks from libbe.command.util import bug_comment_from_user_id from libbe.storage.util import settings_object -from jinja2 import Environment, FileSystemLoader -from datetime import datetime + EMPTY = settings_object.EMPTY @@ -99,7 +103,8 @@ class WebInterface: targets=common_info['possible_targets'], statuses=common_info['possible_statuses'], severities=common_info['possible_severities'], - repository_name=common_info['repository_name']) + repository_name=common_info['repository_name'], + urlencode=urlencode) @cherrypy.expose @@ -145,20 +150,19 @@ class WebInterface: def comment(self, id, body): """The view that handles adding a comment.""" bug = self.bd.bug_from_uuid(id) - shortname = self.bd.bug_shortname(bug) if body.strip() != '': bug.comment_root.new_reply(body=body) bug.save() - - raise cherrypy.HTTPRedirect('/bug?id=%s' % (shortname,), status=302) - - + + raise cherrypy.HTTPRedirect( + '/bug?%s' % urlencode({'id':bug.id.long_user()}), + status=302) + @cherrypy.expose def edit(self, id, status=None, target=None, assignee=None, severity=None, summary=None): """The view that handles editing bug details.""" bug = self.bd.bug_from_uuid(id) - shortname = self.bd.bug_shortname(bug) if summary != None: bug.summary = summary @@ -169,6 +173,8 @@ class WebInterface: bug.severity = severity if severity != 'None' else None bug.save() - - raise cherrypy.HTTPRedirect('/bug?id=%s' % (shortname,), status=302) + + raise cherrypy.HTTPRedirect( + '/bug?%s' % urlencode({'id':bug.id.long_user()}), + status=302) -- 2.26.2