Code

issue2550549: Some bugs issue classifiers were causing database lookup errors
authorrichard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2>
Sat, 28 Nov 2009 22:44:02 +0000 (22:44 +0000)
committerrichard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2>
Sat, 28 Nov 2009 22:44:02 +0000 (22:44 +0000)
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/roundup/trunk@4392 57a73879-2fb5-44c3-a270-3262357dd7e2

CHANGES.txt
roundup/cgi/templating.py
test/test_templating.py

index ab4629e0497d472f435117c9f1ae05bb27e1a6ed..ecd1235256b6d6fb6ce10479b9988bf83d203883 100644 (file)
@@ -15,6 +15,8 @@ Fixes:
   the tracker->web variable. Closes issue2537286, thanks to "stuidge"
   for reporting.
 - Fix some format errors in italian translation file
+- Some bugs issue classifiers were causing database lookup errors
+
 
 2009-10-09 1.4.10 (r4374)
 
index 4c7b2c914b1002be9edd891ed200b9cf90392e5a..6f0584f10d76a69698cb49225f3c108e4f4e3dc6 100644 (file)
@@ -1358,9 +1358,12 @@ class StringHTMLProperty(HTMLProperty):
         elif match.group('email'):
             s = match.group('email')
             return '<a href="mailto:%s">%s</a>'%(s, s)
-        else:
+        elif len(match.group('id')) < 10:
             return self._hyper_repl_item(match,
                 '<a href="%(cls)s%(id)s">%(item)s</a>')
+        else:
+            # just return the matched text
+            return match.group(0)
 
     def _hyper_repl_rst(self, match):
         if match.group('url'):
@@ -1369,8 +1372,11 @@ class StringHTMLProperty(HTMLProperty):
         elif match.group('email'):
             s = match.group('email')
             return '`%s <mailto:%s>`_'%(s, s)
-        else:
+        elif len(match.group('id')) < 10:
             return self._hyper_repl_item(match,'`%(item)s <%(cls)s%(id)s>`_')
+        else:
+            # just return the matched text
+            return match.group(0)
 
     def hyperlinked(self):
         """ Render a "hyperlinked" version of the text """
index a5803491b836abaaa321f8b80a58264e2b1f1dcd..ad6d7585ac94ee37522bc94d37b4f3edefc0462d 100644 (file)
@@ -150,6 +150,7 @@ class HTMLClassTestCase(TemplatingTestCase) :
         ae(t('http://roundup.net/'), '<a href="http://roundup.net/">http://roundup.net/</a>')
         ae(t('&lt;HTTP://roundup.net/&gt;'), '&lt;<a href="HTTP://roundup.net/">HTTP://roundup.net/</a>&gt;')
         ae(t('&lt;www.roundup.net&gt;'), '&lt;<a href="http://www.roundup.net">www.roundup.net</a>&gt;')
+        ae(t('item123123123123'), 'item123123123123')
 
 '''
 class HTMLPermissions: