Skip to content

fix: thread will only be returned for matching course ID - #31340

Merged
mehaknasir merged 2 commits into
masterfrom
inf-669
Dec 1, 2022
Merged

fix: thread will only be returned for matching course ID#31340
mehaknasir merged 2 commits into
masterfrom
inf-669

Conversation

@mehaknasir

@mehaknasir mehaknasir commented Nov 23, 2022

Copy link
Copy Markdown
Contributor

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

@asadazam93 asadazam93 left a comment

Copy link
Copy Markdown
Contributor

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?

Comment thread lms/djangoapps/discussion/rest_api/api.py Outdated
@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
Copy Markdown
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
Copy Markdown
Contributor

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

1 similar comment
@edx-pipeline-bot

Copy link
Copy Markdown
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