From ee9b7147e901f1c395eae379b4059db410d002aa Mon Sep 17 00:00:00 2001 From: Reckless_Satoshi Date: Sun, 21 Apr 2024 22:09:06 +0100 Subject: [PATCH] fix(coordinator): warning on drf serialializer decimal --- api/serializers.py | 3 ++- chat/serializers.py | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/api/serializers.py b/api/serializers.py index 950eaf95..6094e600 100644 --- a/api/serializers.py +++ b/api/serializers.py @@ -1,4 +1,5 @@ from decouple import config +from decimal import Decimal from rest_framework import serializers from .models import MarketTick, Order @@ -583,7 +584,7 @@ class UpdateOrderSerializer(serializers.Serializer): ) routing_budget_ppm = serializers.IntegerField( default=0, - min_value=0, + min_value=Decimal(0), max_value=100_001, allow_null=True, required=False, diff --git a/chat/serializers.py b/chat/serializers.py index a857b786..172abcf5 100644 --- a/chat/serializers.py +++ b/chat/serializers.py @@ -1,5 +1,5 @@ from rest_framework import serializers - +from decimal import Decimal from chat.models import Message @@ -36,7 +36,7 @@ class ChatSerializer(serializers.ModelSerializer): allow_null=True, default=None, required=False, - min_value=0, + min_value=Decimal(0), help_text="Offset for message index to get as response", ) @@ -66,7 +66,7 @@ class PostMessageSerializer(serializers.ModelSerializer): order_id = serializers.IntegerField( required=True, - min_value=0, + min_value=Decimal(0), help_text="Your peer's public key", ) @@ -74,7 +74,7 @@ class PostMessageSerializer(serializers.ModelSerializer): allow_null=True, default=None, required=False, - min_value=0, + min_value=Decimal(0), help_text="Offset for message index to get as response", )