Skip to content

enforce country code to be uppercase #320

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Dec 15, 2017
Merged

enforce country code to be uppercase #320

merged 7 commits into from
Dec 15, 2017

Conversation

Luci2015
Copy link
Collaborator

resolving issue #319
This change is proposed for csv and ldap only.

correcting Issue #
Resolving issue #319 by enforcing the value to be always uppercase
Copy link
Contributor

@adobeDan adobeDan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @Luci2015 the change looks good (modulo the one comment). But you also need to apply it to the Okta connector. Please sync to the latest v2 and look at directory_okta.py in the connector folder. Thanks!

@@ -269,9 +269,9 @@ def iter_users(self, users_filter, extended_attributes):
if sn_value is not None:
user['lastname'] = sn_value
c_value = LDAPValueFormatter.get_attribute_value(record, six.text_type('c'))
source_attributes['c'] = c_value
source_attributes['c'] = c_value.upper() if c_value else None
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The source_attributes should not be uppercased, because it's supposed to show through the actual source value.

@Luci2015
Copy link
Collaborator Author

changes applied; also for Okta

Copy link
Contributor

@adobeDan adobeDan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good changes for the most part, but you went one step too far in the Okta case :). Almost there!

else:
source_attributes['countryCode'] = None
source_attributes['countryCode'] = user['country'] = None
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, the field on the user object is not supposed to be set in this case; only the source object. This line should stay the same.

@Luci2015
Copy link
Collaborator Author

Sorry, I just thought it was a missed users['country'] assignment to None since, following the logic for source_attributes in directory_ldap file. I did not follow where these variable go after..

Copy link
Contributor

@adobeDan adobeDan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! Thanks for the fix!

@adobeDan adobeDan merged commit 1132c5e into adobe-apiplatform:v2 Dec 15, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants