-
Notifications
You must be signed in to change notification settings - Fork 30
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
feat: Updates salesforce opportunity line item form validation #502
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
brobro10000
force-pushed
the
hu/ent-7323
branch
2 times, most recently
from
June 30, 2023 14:39
bb23deb
to
78dee16
Compare
macdiesel
reviewed
Jul 6, 2023
brobro10000
force-pushed
the
hu/ent-7323
branch
3 times, most recently
from
July 6, 2023 20:32
c4aceb7
to
cfa2f32
Compare
iloveagent57
approved these changes
Jul 11, 2023
Comment on lines
152
to
154
if product.plan_type.sf_id_required and \ | ||
self.cleaned_data.get('salesforce_opportunity_line_item') is None or \ | ||
not verify_salesforce_opportunity_product_line_item(self.cleaned_data.get('salesforce_opportunity_line_item')): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: you can use parens to format this type of thing across lines without using backslash, i.e.
if (
product.plan_type.sf_id_required
and self.cleaned_data.get('salesforce_opportunity_line_item') is None
or not verify_salesforce_opportunity_product_line_item(self.cleaned_data.get('salesforce_opportunity_line_item')
):
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds validation on the
SubscriptionPlanForm
class forsalesforce_opportunity_line_item
Uses the approach of a form validation as opposed to model validation to account for existing
salesforce_opportunity_line_item
that do not match the following format:Regex:
/^00k[a-zA-Z0-9]{15}$/
18 alphanumeric characters where the first three characters must be the sequence '00k'
Only the lower case 'k' will be accepted
Overrides the
help_text
for the field to inform the user of the new format restrictions.Adds additional text during validation error specifying that the
salesforce_opportunity_line_item
must start with '00k'Updates the seeded data for devstack with the correct format.
Updates
get_random_salesforce_id
function to match the format due to its uses of generating randomsalesforce_opportunity_line_item
field values for testsDescription
Description of changes made
Link to the associated ticket: https://openedx.atlassian.net/browse/ENT-XXXX
Testing considerations
already been performed.
Post-review
Squash commits into discrete sets of changes