Skip to content

Commit 1132c5e

Browse files
authored
Merge pull request #320 from Luci2015/v2
Fix to #319 (uppercase the country code) by @Luci2015 - thanks!
2 parents dd0cec7 + d40ae58 commit 1132c5e

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

user_sync/connector/directory_csv.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ def get_column_name(key):
159159

160160
country = self.get_column_value(row, country_column_name)
161161
if country is not None:
162-
user['country'] = country
162+
user['country'] = country.upper()
163163

164164
groups = self.get_column_value(row, groups_column_name)
165165
if groups is not None:

user_sync/connector/directory_ldap.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ def iter_users(self, users_filter, extended_attributes):
272272
c_value = LDAPValueFormatter.get_attribute_value(record, six.text_type('c'))
273273
source_attributes['c'] = c_value
274274
if c_value is not None:
275-
user['country'] = c_value
275+
user['country'] = c_value.upper()
276276

277277
if extended_attributes is not None:
278278
for extended_attribute in extended_attributes:

user_sync/connector/directory_okta.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,8 @@ def convert_user(self, record, extended_attributes):
227227
source_attributes['lastName'] = None
228228

229229
if profile.countryCode:
230-
source_attributes['countryCode'] = user['country'] = profile.countryCode
230+
source_attributes['countryCode'] = profile.countryCode
231+
user['country'] = profile.countryCode.upper()
231232
else:
232233
source_attributes['countryCode'] = None
233234

0 commit comments

Comments
 (0)