Skip to content

DecimalElement.__str__() doesn't always return string type #94

@heeplr

Description

@heeplr

A DecimalElement's value can be set to a decimal.Decimal type but it's __str__() method doesn't convert the return value.
This can cause __str__() return a non-string type, which is a bug.

I'm using jinja to render the drafthorse document (as SSOT without any shadow model) and for DecimalElements it fails with:

TypeError: __str__ returned non-string (type decimal.Decimal)

This can be worked around by accessing the private _value directly but should be easy to fix.
(Will prepare a PR)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions