diff --git a/pyproject.toml b/pyproject.toml index 44722365..41cbc366 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -103,6 +103,7 @@ testing = ["pytest", "pytest-django", "coverage"] linting = ["black", "isort", "flake8", "bandit"] [tool.mypy] +strict = true disable_error_code = ["no-redef", "import-untyped"] exclude = ["*/migrations/*"] plugins = ["mypy_django_plugin.main", "mypy_drf_plugin.main"] diff --git a/vibes_auth/serializers.py b/vibes_auth/serializers.py index 2f19cb5a..6a237584 100644 --- a/vibes_auth/serializers.py +++ b/vibes_auth/serializers.py @@ -16,6 +16,7 @@ from rest_framework.fields import ( EmailField, ListField, SerializerMethodField, + JSONField, ) from rest_framework.serializers import ModelSerializer, Serializer from rest_framework_simplejwt.exceptions import TokenError @@ -38,6 +39,7 @@ class UserSerializer(ModelSerializer): password = CharField(write_only=True, required=False) is_staff = BooleanField(read_only=True) recently_viewed = SerializerMethodField(required=False, read_only=True) + attributes = JSONField(required=False) @staticmethod def get_avatar_url(obj) -> str: @@ -53,6 +55,7 @@ class UserSerializer(ModelSerializer): "avatar_url", "is_staff", "recently_viewed", + "attributes", "first_name", "last_name", "password",