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: thread will only be returned for matching course ID #31340

Merged
merged 2 commits into from
Dec 1, 2022
Merged

Conversation

mehaknasir
Copy link
Contributor

@mehaknasir mehaknasir commented Nov 23, 2022

Description

Thread API was returning thread data even for the course the thread is not part of this has been handled in this PR and related frontend change has also been added in a separate PR for discussion MFE

Supporting information

https://2u-internal.atlassian.net/browse/INF-669
openedx/frontend-app-discussions#360

Testing instructions

copy a thread Id from a valid course and append it in the URL of some other course that thread is not part of, the API should return 404 in this case.
http://localhost:18000/api/discussion/v1/threads/{some_valid_thread_id}/?requested_fields=profile_image&course_id={some_valid_but_unrelated_course_id}

make sure to test the positive use case too

Deadline

Copy link
Contributor

@asadazam93 asadazam93 left a comment

Choose a reason for hiding this comment

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

Can we also add a test case where it raises the thread not found error?

lms/djangoapps/discussion/rest_api/api.py Outdated Show resolved Hide resolved
@mehaknasir mehaknasir merged commit 8be2b73 into master Dec 1, 2022
@mehaknasir mehaknasir deleted the inf-669 branch December 1, 2022 11:17
@edx-pipeline-bot
Copy link
Contributor

EdX Release Notice: This PR has been deployed to the staging environment in preparation for a release to production.

@edx-pipeline-bot
Copy link
Contributor

EdX Release Notice: This PR has been deployed to the production environment.

1 similar comment
@edx-pipeline-bot
Copy link
Contributor

EdX Release Notice: This PR has been deployed to the production environment.

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.

4 participants