From ffcf230ecd9bb3a30e3b2dd621f96cb28cac1c80 Mon Sep 17 00:00:00 2001 From: aalpern Date: Tue, 24 Mar 2015 12:58:31 -0700 Subject: [PATCH 1/2] Default to 0 in RenderContext.get_int(), not None --- tessera/_version.py | 2 +- tessera/views.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tessera/_version.py b/tessera/_version.py index 6511e842..b7519648 100644 --- a/tessera/_version.py +++ b/tessera/_version.py @@ -1,2 +1,2 @@ -__version_info__ = (0, 6, 0) +__version_info__ = (0, 6, 1) __version__ = '.'.join(map(str, __version_info__)) diff --git a/tessera/views.py b/tessera/views.py index 0d2e37ff..e93eda67 100644 --- a/tessera/views.py +++ b/tessera/views.py @@ -372,7 +372,7 @@ def __init__(self): def get(self, key, default=None, store_in_session=False): return _get_param(key, default=default, store_in_session=store_in_session) - def get_int(self, key, default=None, store_in_session=False): + def get_int(self, key, default=0, store_in_session=False): return int(self.get(key, default=default, store_in_session=store_in_session)) def get_str(self, key, default=None, store_in_session=False): From b627173439ce72ca79279aeaa7dde69f604708ee Mon Sep 17 00:00:00 2001 From: aalpern Date: Tue, 24 Mar 2015 13:00:54 -0700 Subject: [PATCH 2/2] more defaulting to zero --- tessera/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tessera/views.py b/tessera/views.py index e93eda67..ec4ff7b4 100644 --- a/tessera/views.py +++ b/tessera/views.py @@ -373,7 +373,7 @@ def get(self, key, default=None, store_in_session=False): return _get_param(key, default=default, store_in_session=store_in_session) def get_int(self, key, default=0, store_in_session=False): - return int(self.get(key, default=default, store_in_session=store_in_session)) + return int(self.get(key, default=default, store_in_session=store_in_session) or 0) def get_str(self, key, default=None, store_in_session=False): return str(self.get(key, default=default, store_in_session=store_in_session))