Skip to content

Commit

Permalink
fixed title_if_lower schema serialization
Browse files Browse the repository at this point in the history
  • Loading branch information
vitalik committed Jun 8, 2023
1 parent 933cd3b commit 77e38ca
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion ninja/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""Django Ninja - Fast Django REST framework"""

__version__ = "0.22.1"
__version__ = "0.22.2"

from pydantic import Field

Expand Down
5 changes: 3 additions & 2 deletions ninja/orm/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@

from django.db.models import ManyToManyField
from django.db.models.fields import Field
from django.utils.functional import keep_lazy_text
from pydantic import IPvAnyAddress
from pydantic.fields import FieldInfo, Undefined

Expand All @@ -24,7 +23,9 @@
__all__ = ["create_m2m_link_type", "get_schema_field", "get_related_field_schema"]


@keep_lazy_text
# keep_lazy seems not needed as .title forces translation anyway
# https://github.com/vitalik/django-ninja/issues/774
# @keep_lazy_text
def title_if_lower(s: str) -> str:
if s == s.lower():
return s.title()
Expand Down

0 comments on commit 77e38ca

Please sign in to comment.