Fix redemption display error; add toggle to turn redemption data off#3281
Open
Fix redemption display error; add toggle to turn redemption data off#3281
Conversation
OpenAPI ChangesShow/hide ## Changes for v0.yaml:Unexpected changes? Ensure your branch is up-to-date with |
This file contains hidden or 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
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.
What are the relevant tickets?
n/a
Description (What does it do?)
Noticed when working through mitodl/hq#10117 - when I ran
b2b_codes outputfor the contract, it kept returning codes that apparently had been used. They had learner email addresses listed in the Attach Redemptions column. This seemed weird to me; looking at the code, I realized that there was a typo in the output generation code. The output lists email addresses for redemptions for attachment and for enrollment and the enrollment part was putting the data in the wrong place. So, this fixes that; the attach column should now be blank if the code has only been used for enrollment.I also updated the output subcommand to allow the redemption data to be toggled off. The default mode for
b2b_codes outputis to generate a list of codes that are available for use for contract attachment, with the intent of sending the list to the contract contacts so they can disperse the codes. You don't need to see the enrollment attachments for that. (You may still want to, so it's a toggle.) The toggle is called--no-redemptionsand it defaults to off (show redemption metadata). It does not apply if--allis specified.How can this be tested?
b2b_codes output --contract <id> --all.b2b_codes output --contract <id>(skipping the--allflag). You should see that one of your codes has an enroll redemption, and the email address in there should be correct. You should not see any attach redemptions.b2b_codes output --contract <id> --no-redemptions. You should see the same list of codes but you shouldn't see any redemptions listed.The reasoning for choosing codes from the top and bottom of the list is to increase the probability that you'll see the enroll redemption in the output.