Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

feat: handle nonslug program keys from discovery #596

Merged
merged 1 commit into from
Feb 15, 2024

Conversation

zacharis278
Copy link
Contributor

@zacharis278 zacharis278 commented Feb 14, 2024

Description

This Discovery ADR changed the way Program marketing slugs are generated such that they are no longer guaranteed to be a valid SlugField which makes them unsafe to use as url tokens. Because Registrar supports these values deviating from the source in discovery we're able to translate any non-slug values to something that will work with Registrar and any UI's that rely on it (Program Console + Learner Portal).

This change will only impact new programs moving forward since we do not modify a programs key after a record with that UUID has been synced. This is done to support custom external keys for partners that need a specific value and works to our benefit here.

2U-Internal Ticket: COSMO-185

@@ -127,14 +128,16 @@ def sync_programs(self, program_types):
if discovery_authoring_org:
auth_org = existing_org_dictionary.get(discovery_authoring_org.get('uuid'))
if auth_org:
# key fromd disco is not guarenteed to be a valid slugfield
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
# key fromd disco is not guarenteed to be a valid slugfield
# key from disco is not guaranteed to be a valid slugfield

Copy link
Contributor

@schenedx schenedx left a comment

Choose a reason for hiding this comment

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

👍

@zacharis278 zacharis278 merged commit 8d46897 into master Feb 15, 2024
6 checks passed
@zacharis278 zacharis278 deleted the zhancock/slugify-program-keys branch February 15, 2024 20:58
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants