Skip to content

Commit 2d3ad90

Browse files
author
Justus Pendleton
committed
indexargs_url force ids to int
ids appear as hyperdb.String instances, which confused indexargs_url when they appear in the filterspec. They need to be treated as treated as integers when generating URLs. It feels sort of hacky to check for 'id' like this but I'm at a loss for what else to do in this case. Suggestions are welcome :) Maybe we should look into using some other hyperdb class to represent ids? this fixes [SF#783492] Some trailing whitespace also got trimmed.
1 parent cf19e8b commit 2d3ad90

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

roundup/cgi/templating.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ def _set_input_default_args(dic):
422422

423423
def input_html4(**attrs):
424424
"""Generate an 'input' (html4) element with given attributes"""
425-
_set_input_default_args(attrs)
425+
_set_input_default_args(attrs)
426426
return '<input %s>'%' '.join(['%s="%s"'%(k,cgi.escape(str(v), True))
427427
for k,v in attrs.items()])
428428

@@ -2453,7 +2453,7 @@ def indexargs_url(self, url, args):
24532453
if not args.has_key(k):
24542454
if type(v) == type([]):
24552455
prop = cls.get_transitive_prop(k)
2456-
if isinstance(prop, hyperdb.String):
2456+
if k != 'id' and isinstance(prop, hyperdb.String):
24572457
l.append('%s=%s'%(k, '%20'.join([q(i) for i in v])))
24582458
else:
24592459
l.append('%s=%s'%(k, ','.join([q(i) for i in v])))

0 commit comments

Comments
 (0)