Skip to content

Commit 70e7532

Browse files
committed
Fix #201 (again): catch whitespace-only values, prep for rc1 build
Actually this commit only does the fix, it was the prior commit (685b9fe) that did the release prep.
1 parent 685b9fe commit 70e7532

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

user_sync/connector/directory_ldap.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,7 @@ def iter_users(self, users_filter, extended_attributes):
269269
continue
270270

271271
email, last_attribute_name = self.user_email_formatter.generate_value(record)
272+
email = email.strip() if email else None
272273
if not email:
273274
if last_attribute_name is not None:
274275
self.logger.warning('Skipping user with dn %s: empty email attribute (%s)', dn, last_attribute_name)
@@ -295,6 +296,7 @@ def iter_users(self, users_filter, extended_attributes):
295296
continue
296297

297298
username, last_attribute_name = self.user_username_formatter.generate_value(record)
299+
username = username.strip() if username else None
298300
source_attributes['username'] = username
299301
if username:
300302
user['username'] = username
@@ -305,6 +307,7 @@ def iter_users(self, users_filter, extended_attributes):
305307
user['username'] = email
306308

307309
domain, last_attribute_name = self.user_domain_formatter.generate_value(record)
310+
domain = domain.strip() if domain else None
308311
source_attributes['domain'] = domain
309312
if domain:
310313
user['domain'] = domain

0 commit comments

Comments
 (0)