fix: roles cache organization case-insensitive#53
Merged
shadinaif merged 1 commit intoopen-release/redwood.nelpfrom Feb 11, 2025
Merged
fix: roles cache organization case-insensitive#53shadinaif merged 1 commit intoopen-release/redwood.nelpfrom
shadinaif merged 1 commit intoopen-release/redwood.nelpfrom
Conversation
76c3d5a to
24e266e
Compare
24e266e to
4de5d0e
Compare
OmarIthawi
approved these changes
Jan 15, 2025
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.
Description
RoleCachecomparesorgin a case-sensitive manner while the value oforgis assumed as case-insensitive by the database collation, and by the django admin form. This PR is to fix the issue to makeRoleCachebehave as the rest of the platformSupporting information
Testing instructions
Preperation to test:
test_userdemoorganization:course-v1:Demo+topic1+index1andcourse-v1:demo+topic2+index2. We have the first course with organizationDemoin course-overview instead ofdemo. This is acceptable in the platformBefore the fix:
test_useraninstructoron the entiredemoorganization, the admin will have to grant it course by course. This is becauseCourseAccessRolewill not allow two similar records like[user: test_user, course_id: "", role: instructor, org: demo]and[user: test_user, course_id: "", role: instructor, org: Demo]. The key constraint treatsorgas case-insensitiveAfter the fix:
[user: test_user, course_id: "", role: instructor, org: demo],[user: test_user, course_id: "", role: instructor, org: Demo], or even[user: test_user, course_id: "", role: instructor, org: DEMO]will maketest_useran instructor on all courses as expectedDeadline
Other information