Commit 3fb8680a authored by Michael Hanselmann's avatar Michael Hanselmann
Browse files

rapi: Add default parameter to _checkIntVariable

Signed-off-by: default avatarMichael Hanselmann <>
Reviewed-by: default avatarGuido Trotter <>
Reviewed-by: default avatarIustin Pop <>
parent b4a9eb66
......@@ -233,16 +233,16 @@ class R_Generic(object):
def _checkIntVariable(self, name):
def _checkIntVariable(self, name, default=0):
"""Return the parsed value of an int argument.
val = self.queryargs.get(name, 0)
val = self.queryargs.get(name, default)
if isinstance(val, list):
if val:
val = val[0]
val = 0
val = default
val = int(val)
except (ValueError, TypeError):
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment