Skip to content

Commit

Permalink
refactor: Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Jillian <jill@opencraft.com>
  • Loading branch information
rpenido and pomegranited committed Jul 19, 2023
1 parent a0fedd3 commit de6fa67
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion openedx_tagging/core/tagging/rest_api/v1/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,11 @@ def get_object(self):

def get_queryset(self):
"""
Return a list of taxonomies. If you want the disabled taxonomies, pass enabled=False. If you want all taxonomies (both enabled and disabled), pass enabled=None.
Return a list of taxonomies.
Returns all taxonomies by default.
If you want the disabled taxonomies, pass enabled=False.
If you want the enabled taxonomies, pass enabled=True.
"""
query_params = TaxonomyListQueryParamsSerializer(
data=self.request.query_params.dict()
Expand Down
2 changes: 1 addition & 1 deletion tests/openedx_tagging/core/tagging/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def test_list_taxonomy(self, user_attr, expected_status):
("user", {"enabled": True}, status.HTTP_200_OK),
("user", {"enabled": False}, status.HTTP_404_NOT_FOUND),
("staff", {"enabled": True}, status.HTTP_200_OK),
("staff", {"enabled": True}, status.HTTP_200_OK),
("staff", {"enabled": False}, status.HTTP_200_OK),
)
@ddt.unpack
def test_detail_taxonomy(self, user_attr, taxonomy_data, expected_status):
Expand Down

0 comments on commit de6fa67

Please sign in to comment.