You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Wtform's DecimalField "places" attribute defaults to 2, disregarding mongoengine's DecimalField "precision" attribute.
One of the negative scenarios - if the document is edited by user using wtform (say, some other field is edited), decimal value is rounded to 2 places and data is lost.
Wtform's DecimalField "places" attribute defaults to 2, disregarding mongoengine's DecimalField "precision" attribute.
One of the negative scenarios - if the document is edited by user using wtform (say, some other field is edited), decimal value is rounded to 2 places and data is lost.
Solved it by replacing
return f.DecimalField(**kwargs)
with
return f.DecimalField(places=getattr(field, 'precision', None),**kwargs)
in wtf/orm.py, line 148
The text was updated successfully, but these errors were encountered: