Skip to content
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

ENT-8079 - Make DSC optional based on enterprise config #190

Conversation

zwidekalanga
Copy link
Contributor

Description

Describe in a couple of sentences what this PR adds

Testing instructions

Add some, if applicable

Merge checklist

  • All reviewers approved
  • CI build is green
  • Documentation updated (not only docstrings)
  • Commits are squashed

@adamstankiewicz adamstankiewicz marked this pull request as draft December 21, 2023 15:31
@zwidekalanga zwidekalanga force-pushed the zwidekalanga/ENT-8079/make-dsc-optional branch 2 times, most recently from 81d90df to 085850d Compare December 27, 2023 12:55
@zwidekalanga zwidekalanga marked this pull request as ready for review December 27, 2023 12:55
@zwidekalanga zwidekalanga force-pushed the zwidekalanga/ENT-8079/make-dsc-optional branch from 085850d to 984df22 Compare December 27, 2023 12:56
@zwidekalanga zwidekalanga force-pushed the zwidekalanga/ENT-8079/make-dsc-optional branch from 984df22 to 156bfb9 Compare January 3, 2024 15:30
@zwidekalanga zwidekalanga force-pushed the zwidekalanga/ENT-8079/make-dsc-optional branch from 156bfb9 to 4a1b73c Compare January 3, 2024 16:21
@@ -121,7 +151,11 @@ def _validate(self, transaction):

Raises an exception when the transaction is missing required information
"""
enterprise_customer_data = self._get_enterprise_customer_data(transaction)
enable_data_sharing_consent = enterprise_customer_data.get('enable_data_sharing_consent', False)
for field in self.REQUIRED_METADATA_FIELDS:
Copy link
Member

Choose a reason for hiding this comment

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

[curious] I'm wondering if it'd make sense to conditionally push geag_data_share_consent onto self.REQUIRED_METADATA_FIELDS when enable_data_sharing_consent = True, so that the fields listed in self.REQUIRED_METADATA_FIELDS are truly only the required fields?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The issue is related to the tests since they share they same object adding more removing into the REQUIRED_METADATA_FIELDS array in causes other tests to fail which where support to pass.

Copy link
Member

Choose a reason for hiding this comment

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

Got it. I suppose the other concern is that I'm not sure we'd be able to get at the appropriate enterprise customer within a class constructor, as we are relying on a specific transaction to identify the enterprise customer. I think how you have it is reasonable.

@@ -121,7 +151,11 @@ def _validate(self, transaction):

Raises an exception when the transaction is missing required information
"""
enterprise_customer_data = self._get_enterprise_customer_data(transaction)
enable_data_sharing_consent = enterprise_customer_data.get('enable_data_sharing_consent', False)
for field in self.REQUIRED_METADATA_FIELDS:
Copy link
Member

Choose a reason for hiding this comment

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

Got it. I suppose the other concern is that I'm not sure we'd be able to get at the appropriate enterprise customer within a class constructor, as we are relying on a specific transaction to identify the enterprise customer. I think how you have it is reasonable.

@adamstankiewicz adamstankiewicz merged commit 623591c into openedx:main Jan 22, 2024
8 checks passed
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