Skip to content
Snippets Groups Projects
Commit 07b4be4b authored by Benjamin Bertrand's avatar Benjamin Bertrand
Browse files

Fix IndexError when mail is set to an empty list

IndexError raised due to:
{'cn': 'Alessio Curri (new)', 'sAMAccountName': 'alessiocurri2', 'mail': []}

JIRA INFRA-610 #action In Progress
parent 89a006c8
No related branches found
No related tags found
No related merge requests found
...@@ -111,7 +111,10 @@ def attribute_to_string(value): ...@@ -111,7 +111,10 @@ def attribute_to_string(value):
:returns: string :returns: string
""" """
if isinstance(value, list): if isinstance(value, list):
return value[0] try:
return value[0]
except IndexError:
return ""
else: else:
return value return value
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment