Skip to content

Commit 4d34d1d

Browse files
committed
Cast translated description for DecimalField (#1255)
* Cast translated description for DecimalField graphql-python/graphene-django#976 casts all the description fields to strings to prevent schema printing from failing whenever the description is a lazy translated string. The `DecimalField` however got in after the v3 merge and it currently misses the cast. * Fix row size
1 parent 723a7a9 commit 4d34d1d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

graphene_django/converter.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,9 @@ def convert_field_to_boolean(field, registry=None):
210210

211211
@convert_django_field.register(models.DecimalField)
212212
def convert_field_to_decimal(field, registry=None):
213-
return Decimal(description=field.help_text, required=not field.null)
213+
return Decimal(
214+
description=get_django_field_description(field), required=not field.null
215+
)
214216

215217

216218
@convert_django_field.register(models.FloatField)

0 commit comments

Comments
 (0)