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

fix: not all usage keys matching #226

Merged
merged 1 commit into from
Dec 14, 2023
Merged

Conversation

zacharis278
Copy link
Contributor

@zacharis278 zacharis278 commented Dec 14, 2023

Fixes a bug where the existing regex would not match the entire content id into the capture group

This would break exams for any course with a . in the course id (and likely several other cases).

@zacharis278 zacharis278 force-pushed the zhancock/content-id-parse branch from 3c80e9d to 5fc0c0e Compare December 14, 2023 21:08
@@ -15,6 +15,6 @@ class Status:

COURSE_ID_PATTERN = rf'(?P<course_id>({INTERNAL_COURSE_KEY_PATTERN}|{EXTERNAL_COURSE_KEY_PATTERN}))'

CONTENT_ID_PATTERN = r'(?P<content_id>([A-Za-z0-9-_:@\+]+))'
USAGE_KEY_PATTERN = r'(?P<content_id>(?:i4x://?[^/]+/[^/]+/[^/]+/[^@]+(?:@[^/]+)?)|(?:[^/]+))'
Copy link
Contributor Author

Choose a reason for hiding this comment

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

pulled from edx-platform. I updated the variable to keep the terminology for this matching string consistent.

@zacharis278 zacharis278 merged commit de7957a into main Dec 14, 2023
8 checks passed
@zacharis278 zacharis278 deleted the zhancock/content-id-parse branch December 14, 2023 21:46
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