Fixed #bea/206d9b07# : 'BugDir' object has no attribute 'bug_shortname' (cfbe)
authorW. Trevor King <wking@drexel.edu>
Thu, 15 Jul 2010 10:38:56 +0000 (06:38 -0400)
committerW. Trevor King <wking@drexel.edu>
Thu, 15 Jul 2010 10:38:56 +0000 (06:38 -0400)
Tested with a single bug attribute change and comment addition.

.be/bea86499-824e-4e77-b085-2d581fa9ccab/bugs/206d9b07-6e30-4c8b-9594-ee98e3c646e7/comments/5bcce533-03bb-4b3a-ab77-92d32a7aa054/body [new file with mode: 0644]
.be/bea86499-824e-4e77-b085-2d581fa9ccab/bugs/206d9b07-6e30-4c8b-9594-ee98e3c646e7/comments/5bcce533-03bb-4b3a-ab77-92d32a7aa054/values [new file with mode: 0644]
.be/bea86499-824e-4e77-b085-2d581fa9ccab/bugs/206d9b07-6e30-4c8b-9594-ee98e3c646e7/values
interfaces/web/templates/list.html
interfaces/web/web.py

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 (file)
index 0000000..93d527b
--- /dev/null
@@ -0,0 +1,4 @@
+Fixed by replacing\r
+  '/bug?id=%s' % shortname\r
+with\r
+  '/bug?%s' % urlencode({'id':bug.id.long_user()})\r
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 (file)
index 0000000..ae252e1
--- /dev/null
@@ -0,0 +1,8 @@
+Author: W. Trevor King <wking@drexel.edu>
+
+
+Content-type: text/plain
+
+
+Date: Thu, 15 Jul 2010 10:35:43 +0000
+
index 959cc7a7dd662fbf4dcf613b73eeffcdb1704dbb..f69d98db833e3943b5f417e49873a3131864d6e1 100644 (file)
@@ -7,7 +7,7 @@ reporter: gour <gour@gaura-nitai>
 severity: minor
 
 
-status: open
+status: fixed
 
 
 summary: '''BugDir'' object has no attribute ''bug_shortname'' (cfbe)'
index 83007d3e05658fca609714fccda7a8a449238eaf..216b731ba455df1116d5732b46545aa98d843517 100644 (file)
@@ -16,7 +16,7 @@
         {% for bug in bugs %}
         <tr>
             <td>{{ bug.id.user() }}</td>
-            <td><a href="/bug?id={{ bug.id.user() }}">
+            <td><a href="/bug?{{ urlencode({'id':bug.id.long_user()}) }}">
                 {{ bug.summary|e|truncate(70) }}</a></td>
             <td>{{ bug.status }}</td>
             <td>{{ bug.target }}</td>
index e80f676cec66cdfbb2b9dd1ce1a3f87bb1bdd40e..75a430d82e1074788b07a744abb0485f7fb50479 100644 (file)
@@ -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)