On Wed, Jul 14, 2010 at 08:59:52PM -0400, Chris Ball wrote:
> Yep, all makes perfect sense, +1.

Fixed in my branch.

-- 
This email may be signed or encrypted with GPG (http://www.gnupg.org).
The GPG signature (if present) will be attached as 'signature.asc'.
For more information, see http://en.wikipedia.org/wiki/Pretty_Good_Privacy

My public key is at http://www.physics.drexel.edu/~wking/pubkey.txt
commit 790a33a51a6281535cae338c9f64a675bb6dc6b5
Author: W. Trevor King <[email protected]>
Date:   Thu Jul 15 06:38:56 2010 -0400

    Fixed #bea/206d9b07# : 'BugDir' object has no attribute 'bug_shortname' 
(cfbe)
    
    Tested with a single bug attribute change and comment addition.

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 <[email protected]>
+
+
+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 <g...@gaura-nitai>
 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 %}
         <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>
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)
     

Attachment: pgpCcJ5vUpdTI.pgp
Description: PGP signature

_______________________________________________
Be-devel mailing list
[email protected]
http://void.printf.net/cgi-bin/mailman/listinfo/be-devel

Reply via email to