fix: roles cache organization case-insensitive #53
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
RoleCache
comparesorg
in a case-sensitive manner while the value oforg
is assumed as case-insensitive by the database collation, and by the django admin form. This PR is to fix the issue to makeRoleCache
behave as the rest of the platformSupporting information
Testing instructions
Preperation to test:
test_user
demo
organization:course-v1:Demo+topic1+index1
andcourse-v1:demo+topic2+index2
. We have the first course with organizationDemo
in course-overview instead ofdemo
. This is acceptable in the platformBefore the fix:
test_user
aninstructor
on the entiredemo
organization, the admin will have to grant it course by course. This is becauseCourseAccessRole
will 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 treatsorg
as 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_user
an instructor on all courses as expectedDeadline
Other information