diff --git a/src/app.py b/src/app.py index 017dc9b..03c7a0b 100644 --- a/src/app.py +++ b/src/app.py @@ -98,6 +98,7 @@ def get(self): result = dict() projects = dict() + notes = list() redmine = Redmine(redmineurl, key=apikey) @@ -149,6 +150,12 @@ def get(self): assign_ids.append(group.id) rm_groups[group.id] = group + # if groups are empty we might not have the rights to retrieve them, cf. + # https://github.com/penguineer/RedmineActionablesCollector/issues/1 + if not rm_groups: + notes.append("Redmine groups came back empty. " + "Either there are no groups or you do not have sufficient rights to retrieve groups!") + # filter IDs of those issues assigned to the current user issues_actionable = set(map(lambda i: i.id, filter( @@ -332,6 +339,8 @@ def get(self): issues[issue.id] = entry result['issues'] = issues + result['notes'] = notes + self.set_header("Content-Type", "application/json") self.write(json.dumps(result, indent=4)) self.set_status(200)