diff roundup/cgi/templating.py @ 7122:94a5a9e6f0d2

Fix traceback on integer order attribute, fix comment Ralf Schlatterbeck's commit cb39a6c95cd3 did not include hyperdb.Integer support. This commit adds it. Also fixes associated comment.
author John Rouillard <rouilj@ieee.org>
date Sat, 21 Jan 2023 12:52:24 -0500
parents cb39a6c95cd3
children 82bbb95e5690 d267b0454500
line wrap: on
line diff
--- a/roundup/cgi/templating.py	Thu Jan 19 14:40:52 2023 +0100
+++ b/roundup/cgi/templating.py	Sat Jan 21 12:52:24 2023 -0500
@@ -2952,9 +2952,9 @@
     def keyfunc(a):
         if num_re.match(a):
             a = linkcl.get(a, sort_on)
-            # In Python3 we may not compare strings and None
+            # In Python3 we may not compare numbers/strings and None
             if a is None:
-                if isinstance(prop, hyperdb.Number):
+                if isinstance(prop, (hyperdb.Number, hyperdb.Integer)):
                     return 0
                 return ''
         return a

Roundup Issue Tracker: http://roundup-tracker.org/