Skip to content

Commit

Permalink
Rename views and serializer
Browse files Browse the repository at this point in the history
  • Loading branch information
romanmyko committed Dec 15, 2024
1 parent dbc68db commit a54e667
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion BackEnd/administration/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ class FeedbackSerializer(serializers.Serializer):
)


class ManageCategoriesSerializer(serializers.ModelSerializer):
class CategoriesListSerializer(serializers.ModelSerializer):
name = serializers.CharField(
validators=[
UniqueValidator(
Expand Down
4 changes: 2 additions & 2 deletions BackEnd/administration/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
ModerationEmailView,
FeedbackView,
CreateAdminUserView,
ManageCategoriesView,
CategoriesListView,
CategoryDetailView,
SendMessageView,
)
Expand Down Expand Up @@ -39,7 +39,7 @@
path("admin_create/", CreateAdminUserView.as_view(), name="admin-create"),
path(
"categories/",
ManageCategoriesView.as_view(),
CategoriesListView.as_view(),
name="categories",
),
path(
Expand Down
6 changes: 3 additions & 3 deletions BackEnd/administration/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
AdminUserDetailSerializer,
AutoModerationHoursSerializer,
ModerationEmailSerializer,
ManageCategoriesSerializer,
CategoriesListSerializer,
CategoryDetailSerializer,
StatisticsSerializer,
)
Expand Down Expand Up @@ -227,7 +227,7 @@ def perform_create(self, serializer):
send_email_feedback(email, message, category)


class ManageCategoriesView(ListCreateAPIView):
class CategoriesListView(ListCreateAPIView):
"""
Manage categories
### Query Parameters:
Expand All @@ -242,7 +242,7 @@ class ManageCategoriesView(ListCreateAPIView):
"""

permission_classes = [IsStaffUser]
serializer_class = ManageCategoriesSerializer
serializer_class = CategoriesListSerializer
filter_backends = [DjangoFilterBackend]
filterset_class = CategoriesFilter
pagination_class = ListPagination
Expand Down

0 comments on commit a54e667

Please sign in to comment.