From 03f5335229214c247d5e8c3bc922f1e96a7a1a34 Mon Sep 17 00:00:00 2001
From: Carina Antunes <carina.oliveira.antunes@cern.ch>
Date: Mon, 31 Jul 2023 15:14:37 +0200
Subject: [PATCH] Ignore groups not found

---
 notifications_routing/authorization_service.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/notifications_routing/authorization_service.py b/notifications_routing/authorization_service.py
index 84dfc4b..e898e31 100644
--- a/notifications_routing/authorization_service.py
+++ b/notifications_routing/authorization_service.py
@@ -41,6 +41,9 @@ def get_group_users_api(group_id: str):
     headers = {"Authorization": "Bearer {}".format(token)}
 
     response = _get_group_users(group_id, headers)
+    if "data" not in response:
+        return []
+
     data = response["data"]
 
     while response.get("pagination").get("next"):
-- 
GitLab