Skip to content

Commit 364ff3f

Browse files
committed
fix isset() for StringHTMLProperty
isset() is used in templates on a StringHTMLProperty, it returns True. 2.1.0 made default_value work properly. Hyperdb.py's String(_Type) class sets the default value to the empty string and not None. Change __init__ so default_value is None and not "". roundup-user mailing list thread: https://sourceforge.net/p/roundup/mailman/roundup-users/thread/20210801020640.73ac1729%40Dell/#msg37328813
1 parent be981dd commit 364ff3f

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

CHANGES.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,13 @@ Fixed:
3232

3333
- issue2551122 - fixing order by a link/multilink broke other props
3434
should be final change for that ticket. (John Rouillard)
35+
- when isset() is used in templates on a StringHTMLProperty, it
36+
returns True. 2.1.0 made default_value work properly. Hyperdb's
37+
String(_Type) class sets the default value to the empty string and
38+
not None. Change __init__ so default_value is None and not "".
39+
roundup-user mailing list thread:
40+
https://sourceforge.net/p/roundup/mailman/roundup-users/thread/20210801020640.73ac1729%40Dell/#msg37328813
41+
(reported by Nagy Gabor. fix: John Rouillard)
3542

3643
Features:
3744

roundup/hyperdb.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ def sort_repr(self, cls, val, name):
7777

7878
class String(_Type):
7979
"""An object designating a String property."""
80-
def __init__(self, indexme='no', required=False, default_value="",
80+
def __init__(self, indexme='no', required=False, default_value=None,
8181
quiet=False):
8282
super(String, self).__init__(required, default_value, quiet)
8383
self.indexme = indexme == 'yes'

0 commit comments

Comments
 (0)