Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
KoalaSat committed Jun 21, 2024
1 parent 9b7f657 commit 53a5c84
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
9 changes: 0 additions & 9 deletions api/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -490,15 +490,6 @@ class Meta:
)


class NotificationSerializer(serializers.ModelSerializer):
title = serializers.CharField(required=True)
description = serializers.CharField(required=False)

class Meta:
model = Notification
fields = ("title", "description", "order_id")


class ListNotificationSerializer(serializers.ModelSerializer):
class Meta:
model = Notification
Expand Down
5 changes: 2 additions & 3 deletions api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@
StealthSerializer,
TickSerializer,
UpdateOrderSerializer,
NotificationSerializer,
ListNotificationSerializer,
)
from api.utils import (
Expand Down Expand Up @@ -745,7 +744,7 @@ def get(self, request, format=None):
class NotificationsView(ListAPIView):
authentication_classes = [TokenAuthentication]
permission_classes = [IsAuthenticated]
serializer_class = NotificationSerializer
serializer_class = ListNotificationSerializer

@extend_schema(**NotificationSchema.get)
def get(self, request, format=None):
Expand All @@ -762,7 +761,7 @@ def get(self, request, format=None):

notification_data = []
for notification in queryset:
data = ListNotificationSerializer(notification).data
data = self.serializer_class(notification).data
data["title"] = str(notification.title)
data["description"] = str(notification.description)
data["order_id"] = str(notification.order.id)
Expand Down

0 comments on commit 53a5c84

Please sign in to comment.