Skip to content

Commit 56f93b3

Browse files
committed
squash!: Apply suggestions
1 parent a956ec2 commit 56f93b3

4 files changed

Lines changed: 11 additions & 14 deletions

File tree

openedx_authz/rest_api/v1/serializers.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -169,14 +169,6 @@ class ListRolesWithScopeResponseSerializer(serializers.Serializer): # pylint: d
169169
user_count = serializers.IntegerField()
170170

171171

172-
class OrganizationSerializer(serializers.Serializer): # pylint: disable=abstract-method
173-
"""Serializer for Organization model."""
174-
175-
id = serializers.IntegerField()
176-
name = serializers.CharField()
177-
short_name = serializers.CharField()
178-
179-
180172
class UserRoleAssignmentSerializer(serializers.Serializer): # pylint: disable=abstract-method
181173
"""Serializer for a user role assignment."""
182174

openedx_authz/rest_api/v1/urls.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@
1212
),
1313
path("roles/", views.RoleListView.as_view(), name="role-list"),
1414
path("roles/users/", views.RoleUserAPIView.as_view(), name="role-user-list"),
15-
path("orgs/", views.OrgsAPIView.as_view(), name="orgs-view"),
15+
path("orgs/", views.OrgsAPIView.as_view(), name="orgs-list"),
1616
]

openedx_authz/rest_api/v1/views.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
from django.http import HttpRequest
1313
from edx_api_doc_tools import schema_for
1414
from organizations.models import Organization
15+
from organizations.serializers import OrganizationSerializer
1516
from rest_framework import filters, generics, status
1617
from rest_framework.response import Response
1718
from rest_framework.views import APIView
@@ -34,7 +35,6 @@
3435
ListRolesWithScopeResponseSerializer,
3536
ListRolesWithScopeSerializer,
3637
ListUsersInRoleWithScopeSerializer,
37-
OrganizationSerializer,
3838
PermissionValidationResponseSerializer,
3939
PermissionValidationSerializer,
4040
RemoveUsersFromRoleWithScopeSerializer,
@@ -507,14 +507,19 @@ class OrgsAPIView(generics.ListAPIView):
507507
"results": [
508508
{
509509
"id": 1,
510-
"name": "edX",
511-
"short_name": "edx"
510+
"created": "2026-04-02T19:30:36.779095Z",
511+
"modified": "2026-04-02T19:30:36.779095Z",
512+
"name": "OpenedX",
513+
"short_name": "OpenedX",
514+
"description": "",
515+
"logo": null,
516+
"active": true
512517
}
513518
]
514519
}
515520
"""
516521

517-
queryset = Organization.objects.order_by("name")
522+
queryset = Organization.objects.filter(active=True).order_by("name")
518523
serializer_class = OrganizationSerializer
519524
pagination_class = AuthZAPIViewPagination
520525
filter_backends = [filters.SearchFilter]

openedx_authz/tests/rest_api/test_views.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -874,7 +874,7 @@ def setUpTestData(cls):
874874
def setUp(self):
875875
"""Set up test fixtures."""
876876
super().setUp()
877-
self.url = reverse("openedx_authz:orgs-view")
877+
self.url = reverse("openedx_authz:orgs-list")
878878

879879
def test_get_orgs_returns_all(self):
880880
"""Test that all orgs are returned when no search param is provided.

0 commit comments

Comments
 (0)