From 7a7e35fe7b8b8ad73bb12729756cbf086687e27c Mon Sep 17 00:00:00 2001 From: Charlie Bini Date: Fri, 14 Aug 2020 19:40:16 +0000 Subject: [PATCH] fix positive termid --- powerschool/__init__.py | 2 +- powerschool/utils.py | 2 ++ pyproject.toml | 2 +- tests/test_powerschool.py | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/powerschool/__init__.py b/powerschool/__init__.py index 46bd880..d88376e 100644 --- a/powerschool/__init__.py +++ b/powerschool/__init__.py @@ -1,4 +1,4 @@ -__version__ = '1.0.3' +__version__ = '1.0.4' from oauthlib.oauth2 import BackendApplicationClient from requests_oauthlib import OAuth2Session diff --git a/powerschool/utils.py b/powerschool/utils.py index b828383..3d1af0f 100644 --- a/powerschool/utils.py +++ b/powerschool/utils.py @@ -28,6 +28,8 @@ def get_constraint_values(selector, arg_value, step_size): arg_next = arg_value + step_size elif selector == 'termid' and arg_value < 0: arg_next = arg_value - step_size + elif selector == 'termid' and arg_value >= 0: + arg_next = arg_value + step_size elif 'date' in selector and type(arg_value) is str: arg_value = datetime.datetime.strptime(arg_value, '%Y-%m-%d').date() arg_next = arg_value + step_size diff --git a/pyproject.toml b/pyproject.toml index 310b7b8..02ca5e8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "powerschool" -version = "1.0.3" +version = "1.0.4" description = "powerschool is a Python client for the PowerSchool API" homepage = "https://github.com/TEAMSchools/powerschool" repository = "https://github.com/TEAMSchools/powerschool" diff --git a/tests/test_powerschool.py b/tests/test_powerschool.py index 85f50c4..b0db129 100644 --- a/tests/test_powerschool.py +++ b/tests/test_powerschool.py @@ -2,4 +2,4 @@ def test_version(): - assert __version__ == '1.0.3' + assert __version__ == '1.0.4'