Commit eee998926aa477c289135900c9dff572800ed8f1

Authored by Sergio Oliveira
1 parent 31c7cbea

Checking for errors in mailman-api before using results

Signed-off-by: Alexandre Barbosa <alexandreab@live.com>
Signed-off-by: Macartur Sousa <macartur.sc@gmail.com>
Signed-off-by: Sergio Oliveira <sergio@tracy.com.br>
Showing 1 changed file with 6 additions and 1 deletions   Show diff stats
colab/accounts/utils/mailman.py
@@ -139,7 +139,12 @@ def list_users(listname): @@ -139,7 +139,12 @@ def list_users(listname):
139 except requests.exceptions.RequestException: 139 except requests.exceptions.RequestException:
140 return [] 140 return []
141 141
142 - return users.json() 142 + result = users.json()
  143 + if isinstance(result, int):
  144 + LOGGER.error('Error number %s', result)
  145 + return []
  146 +
  147 + return result
143 148
144 149
145 def get_user_mailinglists(user): 150 def get_user_mailinglists(user):