commit/galaxy-central: nsoranzo: Fix min/max integer param validation when either is 0.
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/a878a8eccd4c/ Changeset: a878a8eccd4c Branch: stable User: nsoranzo Date: 2013-11-08 17:46:37 Summary: Fix min/max integer param validation when either is 0. Bug introduced in commit 5b4c4cf9bc9619d51d7f2471d64896dcdd93707c . InRangeValidator would not be appended because self.min and self.max are no more strings, but integers. Reported by: Andrea Pinna <andrea.pinna@crs4.it> Affected #: 1 file diff -r b05a551b68ada167d1afd5be03c59baeb87402d1 -r a878a8eccd4c6856660fc73563aa0296c67a6b89 lib/galaxy/tools/parameters/basic.py --- a/lib/galaxy/tools/parameters/basic.py +++ b/lib/galaxy/tools/parameters/basic.py @@ -268,7 +268,7 @@ self.max = int( self.max ) except: raise ValueError( "An integer is required" ) - if self.min and self.max: + if self.min is not None and self.max is not None: self.validators.append( validation.InRangeValidator( None, self.min, self.max ) ) def get_html_field( self, trans=None, value=None, other_values={} ): @@ -338,15 +338,15 @@ raise ValueError( "The settings for this field require a 'value' setting and optionally a default value which must be a real number" ) if self.min: try: - float( self.min ) + self.min = float( self.min ) except: raise ValueError( "A real number is required" ) if self.max: try: - float( self.max ) + self.max = float( self.max ) except: raise ValueError( "A real number is required" ) - if self.min and self.max: + if self.min is not None and self.max is not None: self.validators.append( validation.InRangeValidator( None, self.min, self.max ) ) def get_html_field( self, trans=None, value=None, other_values={} ): Repository URL: https://bitbucket.org/galaxy/galaxy-central/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.
participants (1)
-
commits-noreply@bitbucket.org