Fixed course being accessed from studio of another site - #595
Merged
Conversation
manan-memon
requested review from
Anas-hameed,
muhammadali286 and
taimoor-ahmed-1
November 8, 2024 12:41
manan-memon
force-pushed
the
manan/EDLY-7167
branch
from
November 11, 2024 13:32
3b67e9d to
662f7cf
Compare
Anas-hameed
suggested changes
Nov 13, 2024
| :param user: | ||
| :param course_key: a CourseKey | ||
| """ | ||
| # verify if the course is from requesting site |
There was a problem hiding this comment.
nit: we can remove the inline comment.
Comment on lines
+108
to
+120
| def is_course_org_in_site_filter_orgs(course_key): | ||
| """ | ||
| Check if the course organization is in the current site's organization filters. | ||
|
|
||
| :param course_key: a CourseKey object representing the course | ||
| :return: True if the course organization is in the site organization filters, False otherwise | ||
| """ | ||
| site_orgs = configuration_helpers.get_current_site_orgs() | ||
| if course_key.org not in site_orgs: | ||
| return False | ||
| return True | ||
|
|
||
|
|
There was a problem hiding this comment.
Isn't this function duplicate? Can you define a single function in EDLY app and import from there?
Author
There was a problem hiding this comment.
As we discussed, I have changed it to use the is_course_org_same_as_site_org from edly app
manan-memon
force-pushed
the
manan/EDLY-7167
branch
from
November 14, 2024 09:08
662f7cf to
26404a2
Compare
taimoor-ahmed-1
approved these changes
Nov 15, 2024
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.
This PR fixes the issue of course endpoints of a different organization being accessed from another site for admin.
JIRA: https://edlyio.atlassian.net/browse/EDLY-7167