X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/d5a6347a4687eff0f47e832407160bdec086bd75..52f5582c513e41f069f60b5e45b457dc17413166:/src/api/serializers.py diff --git a/src/api/serializers.py b/src/api/serializers.py index dae587c84..4ba660e26 100644 --- a/src/api/serializers.py +++ b/src/api/serializers.py @@ -15,10 +15,11 @@ class PlainSerializer(serializers.ModelSerializer): class UserSerializer(serializers.ModelSerializer): premium = UserPremiumField() + confirmed = serializers.BooleanField(source='is_active') class Meta: model = User - fields = ['username', 'premium'] + fields = ['username', 'premium', 'confirmed'] class BookUserDataSerializer(serializers.ModelSerializer): @@ -30,3 +31,14 @@ class BookUserDataSerializer(serializers.ModelSerializer): class LoginSerializer(serializers.Serializer): username = serializers.CharField() password = serializers.CharField(style={'input_type': 'password'}) + + + +class RegisterSerializer(serializers.Serializer): + email = serializers.CharField() + password = serializers.CharField(style={'input_type': 'password'}) + options = serializers.ListField(child=serializers.IntegerField()) + + +class RefreshTokenSerializer(serializers.Serializer): + refresh_token = serializers.CharField(style={'input_type': 'password'})