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.
This commit is contained in:
andrei-datcu 2021-08-11 21:43:53 +03:00 committed by GitHub
parent e7f7d8da07
commit 00ac51c83d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -205,7 +205,7 @@ 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)