From 56892d7f4b2c4d237f726092a5ec5987631569e6 Mon Sep 17 00:00:00 2001 From: andrei-datcu Date: Thu, 22 Sep 2022 12:13:30 -0600 Subject: [PATCH] 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 --- graphene_django/converter.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/graphene_django/converter.py b/graphene_django/converter.py index 90b1466..2c4fa19 100644 --- a/graphene_django/converter.py +++ b/graphene_django/converter.py @@ -210,7 +210,9 @@ def convert_field_to_boolean(field, registry=None): @convert_django_field.register(models.DecimalField) 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)