From 8acda2956909e639c26b5c541938c242a56a7c43 Mon Sep 17 00:00:00 2001 From: Michael Currin <18750745+MichaelCurrin@users.noreply.github.com> Date: Thu, 19 Aug 2021 23:30:38 +0200 Subject: [PATCH] Update redmine.py --- redmine/redmine.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/redmine/redmine.py b/redmine/redmine.py index 440ab7f..896525b 100644 --- a/redmine/redmine.py +++ b/redmine/redmine.py @@ -60,9 +60,10 @@ def set_cache(self, cache_file, data): cf.write(json.dumps(data)) def get(self, resource, cache=True, **kwargs): - # Some resources (i.e issue_priorities) have paths that contain "/" + # Some resources (i.e. issue_priorities) have paths that contain "/" rname = resource.split("/")[-1] cache_file = os.path.join(self.cache_dir, "{}.json".format(rname)) + if os.path.exists(cache_file): with open(cache_file, "r") as cf: data = json.loads(cf.read()) @@ -75,6 +76,7 @@ def get(self, resource, cache=True, **kwargs): def get_users(self): cache_file = os.path.join(self.cache_dir, "users.json") + if os.path.exists(cache_file): with open(cache_file, "r") as cf: users = json.loads(cf.read()) @@ -156,6 +158,7 @@ def get_issues(self, **kwargs): def get_issue(self, issue_id, journals): query_params = {} + if journals: query_params["include"] = "journals" resp = requests.get(