Skip to content

Commit 624b918

Browse files
authored
fix: Deprecated Config In ModelSchema (#157)
* fixed deprecated Config in ModelSchema * 5.4.2
1 parent 5a2c90c commit 624b918

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

ninja_jwt/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
"""Django Ninja JWT - JSON Web Token for Django-Ninja"""
22

3-
__version__ = "5.4.0"
3+
__version__ = "5.4.2"

ninja_jwt/schema.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@ def get_values(self) -> Dict:
5454

5555

5656
class AuthUserSchema(ModelSchema):
57-
class Config:
57+
class Meta:
5858
model = get_user_model()
59-
model_fields = [user_name_field]
59+
fields = [user_name_field]
6060

6161

6262
class InputSchemaMixin:
@@ -126,10 +126,10 @@ def get_token(cls, user: AbstractUser) -> Dict:
126126

127127

128128
class TokenObtainInputSchemaBase(ModelSchema, TokenInputSchemaMixin):
129-
class Config:
129+
class Meta:
130130
# extra = "forbid"
131131
model = get_user_model()
132-
model_fields = ["password", user_name_field]
132+
fields = ["password", user_name_field]
133133

134134
@model_validator(mode="before")
135135
def validate_inputs(cls, values: SCHEMA_INPUT) -> dict:

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ dependencies = [
5050
"Django >= 2.1",
5151
"pyjwt>=1.7.1,<3",
5252
"pyjwt[crypto]",
53-
"django-ninja-extra >= 0.22.9",
5453
"pydantic-settings>=2.0.0",
54+
"django-ninja-extra >= 0.30.5"
5555
]
5656

5757

0 commit comments

Comments
 (0)