Skip to content

Commit dec6770

Browse files
committed
squash!: Attend PR reviews
1 parent bf4d93d commit dec6770

4 files changed

Lines changed: 7 additions & 7 deletions

File tree

openedx_authz/rest_api/data.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class UserAssignmentSortField(BaseEnum):
3434
ROLE = "role"
3535
ORG = "org"
3636
SCOPE = "scope"
37-
NAME = "full_name"
37+
FULL_NAME = "full_name"
3838
USERNAME = "username"
3939
EMAIL = "email"
4040

openedx_authz/rest_api/v1/filters.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,6 @@ class UserAssignmentsOrderingFilter(BaseFilterBackend):
5151
"""Sort user assignments by a given field and order."""
5252

5353
def filter_queryset(self, request, queryset, view):
54-
sort_by = request.query_params.get("sort_by", UserAssignmentSortField.ROLE)
54+
sort_by = request.query_params.get("sort_by", UserAssignmentSortField.FULL_NAME)
5555
order = request.query_params.get("order", SortOrder.ASC)
5656
return sort_user_assignments(assignments=queryset, sort_by=sort_by, order=order)

openedx_authz/rest_api/v1/serializers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,5 +377,5 @@ class ListAssignmentsQuerySerializer(ListTeamMemberAssignmentsQuerySerializer):
377377
sort_by = serializers.ChoiceField(
378378
required=False,
379379
choices=[(e.value, e.name) for e in UserAssignmentSortField],
380-
default=UserAssignmentSortField.NAME,
380+
default=UserAssignmentSortField.FULL_NAME,
381381
)

openedx_authz/rest_api/v1/views.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,7 @@ def get(self, request: HttpRequest) -> Response:
496496
responses={
497497
status.HTTP_200_OK: OrganizationSerializer(many=True),
498498
status.HTTP_401_UNAUTHORIZED: "The user is not authenticated",
499-
status.HTTP_403_FORBIDDEN: "The user does not have the required permisisons",
499+
status.HTTP_403_FORBIDDEN: "The user does not have the required permissions",
500500
},
501501
)
502502
class AdminConsoleOrgsAPIView(generics.ListAPIView):
@@ -642,7 +642,7 @@ class TeamMembersAPIView(APIView):
642642
status.HTTP_200_OK: ListRolesWithScopeResponseSerializer(many=True),
643643
status.HTTP_400_BAD_REQUEST: "The request parameters are invalid",
644644
status.HTTP_401_UNAUTHORIZED: "The user is not authenticated",
645-
status.HTTP_403_FORBIDDEN: "The user does not have the required permisisons",
645+
status.HTTP_403_FORBIDDEN: "The user does not have the required permissions",
646646
},
647647
)
648648
@authz_permissions(
@@ -847,7 +847,7 @@ class TeamMemberAssignmentsAPIView(APIView):
847847
status.HTTP_200_OK: TeamMemberAssignmentSerializer(many=True),
848848
status.HTTP_400_BAD_REQUEST: "The request parameters are invalid",
849849
status.HTTP_401_UNAUTHORIZED: "The user is not authenticated",
850-
status.HTTP_403_FORBIDDEN: "The user does not have the required permisisons",
850+
status.HTTP_403_FORBIDDEN: "The user does not have the required permissions",
851851
},
852852
)
853853
@authz_permissions(
@@ -983,7 +983,7 @@ class AssignmentsAPIView(APIView):
983983
status.HTTP_200_OK: TeamMemberUserAssignmentSerializer(many=True),
984984
status.HTTP_400_BAD_REQUEST: "The request parameters are invalid",
985985
status.HTTP_401_UNAUTHORIZED: "The user is not authenticated",
986-
status.HTTP_403_FORBIDDEN: "The user does not have the required permisisons",
986+
status.HTTP_403_FORBIDDEN: "The user does not have the required permissions",
987987
},
988988
)
989989
@authz_permissions(

0 commit comments

Comments
 (0)