Cast translated description for DecimalField (#1255)

* Cast translated description for DecimalField

https://github.com/graphql-python/graphene-django/pull/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
This commit is contained in:
andrei-datcu 2022-09-22 12:13:30 -06:00 committed by GitHub
parent 4f315c365d
commit 56892d7f4b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -210,7 +210,9 @@ def convert_field_to_boolean(field, registry=None):
@convert_django_field.register(models.DecimalField) @convert_django_field.register(models.DecimalField)
def convert_field_to_decimal(field, registry=None): def convert_field_to_decimal(field, registry=None):
return Decimal(description=field.help_text, required=not field.null) return Decimal(
description=get_django_field_description(field), required=not field.null
)
@convert_django_field.register(models.FloatField) @convert_django_field.register(models.FloatField)