Skip to content

Commit

Permalink
Improve type hints for UserSerializer (#4429)
Browse files Browse the repository at this point in the history
* Improve type hints for UserSerializer

* Fix NameError for UserType
  • Loading branch information
browniebroke authored Jul 11, 2023
1 parent a78f273 commit 67a7194
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
from django.contrib.auth import get_user_model
from rest_framework import serializers

from {{ cookiecutter.project_slug }}.users.models import User as UserType


User = get_user_model()


class UserSerializer(serializers.ModelSerializer):
class UserSerializer(serializers.ModelSerializer[UserType]):
class Meta:
model = User
{%- if cookiecutter.username_type == "email" %}
Expand Down

0 comments on commit 67a7194

Please sign in to comment.