You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On page https://ldap3.readthedocs.io/en/latest/tutorial_searches.html#what-about-empty-attributes it says as follows: “ This feature makes it harder to access the entry in your code because you must always check if an attribute key is present before accessing its value to avoid exceptions. ldap3 helps you to write simpler code because by default it returns an empty attribute even if it is not present in the LDAP”
An example of how to check for an empty attribute value would be appreciated. The shell prints no value, but it is not clear how to check for it.
What I do, is write ldap_entry.attribute.value is not None. Not sure how this is any better than checking if the attribute exists when setting return_empty_attributes=False in connection options.
Am I missing something?
The text was updated successfully, but these errors were encountered:
On page https://ldap3.readthedocs.io/en/latest/tutorial_searches.html#what-about-empty-attributes it says as follows: “ This feature makes it harder to access the entry in your code because you must always check if an attribute key is present before accessing its value to avoid exceptions. ldap3 helps you to write simpler code because by default it returns an empty attribute even if it is not present in the LDAP”
An example of how to check for an empty attribute value would be appreciated. The shell prints no value, but it is not clear how to check for it.
What I do, is write ldap_entry.attribute.value is not None. Not sure how this is any better than checking if the attribute exists when setting return_empty_attributes=False in connection options.
Am I missing something?
The text was updated successfully, but these errors were encountered: