Skip to content

Commit

Permalink
feat: added not responded filter for fetch thread list api
Browse files Browse the repository at this point in the history
  • Loading branch information
mehaknasir committed Nov 10, 2022
1 parent f03b141 commit e1dba40
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lms/djangoapps/discussion/rest_api/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -873,7 +873,7 @@ def get_thread_list(
}

if view:
if view in ["unread", "unanswered"]:
if view in ["unread", "unanswered", "unresponded"]:
query_params[view] = "true"
else:
ValidationError({
Expand Down
2 changes: 1 addition & 1 deletion lms/djangoapps/discussion/rest_api/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class ThreadListGetForm(_PaginationForm):
count_flagged = ExtendedNullBooleanField(required=False)
flagged = ExtendedNullBooleanField(required=False)
view = ChoiceField(
choices=[(choice, choice) for choice in ["unread", "unanswered"]],
choices=[(choice, choice) for choice in ["unread", "unanswered", "unresponded"]],
required=False,
)
order_by = ChoiceField(
Expand Down
2 changes: 1 addition & 1 deletion lms/djangoapps/discussion/rest_api/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -955,7 +955,7 @@ def test_basic(self):
"per_page": ["10"],
})

@ddt.data("unread", "unanswered")
@ddt.data("unread", "unanswered", "unresponded")
def test_view_query(self, query):
threads = [make_minimal_cs_thread()]
self.register_get_user_response(self.user)
Expand Down
2 changes: 1 addition & 1 deletion lms/djangoapps/discussion/rest_api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ class ThreadViewSet(DeveloperErrorViewMixin, ViewSet):
* view: "unread" for threads the requesting user has not read, or
"unanswered" for question threads with no marked answer. Only one
can be selected.
can be selected, or unresponded for discussion type posts with no response
* requested_fields: (list) Indicates which additional fields to return
for each thread. (supports 'profile_image')
Expand Down

0 comments on commit e1dba40

Please sign in to comment.