diff --git a/get_emails.py b/get_emails.py index aba9a1f..3ebfc14 100755 --- a/get_emails.py +++ b/get_emails.py @@ -20,9 +20,12 @@ for user in api.mattermost(ENDPOINTS["mattermost"]): if "is_bot" not in user: emails.append(user["email"]) -for user in api.mailcow(ENDPOINTS["mailcow"]): - if user["username"] not in os.environ["EXCLUDED_EMAILS"]: - emails.append(user["username"]) +try: + for user in api.mailcow(ENDPOINTS["mailcow"]): + if user["username"] not in os.environ["EXCLUDED_EMAILS"]: + emails.append(user["username"]) +except TypeError: + print("Mailcow : What is your IP address ?") for user in api.nextcloud(ENDPOINTS["nextcloud"])["ocs"]["data"]["users"]: emails.append(api.nextcloud(ENDPOINTS["nextcloud"] + '/' + user)["ocs"]["data"]["email"])