fixed clearing amount in recipe edit would result in error

This commit is contained in:
vabene1111 2020-09-22 09:09:52 +02:00
parent 5e2dba7b04
commit 30d766be77

View File

@ -21,6 +21,8 @@ class CustomDecimalField(serializers.Field):
if type(data) == int or type(data) == float:
return data
elif type(data) == str:
if data == '':
return 0
try:
return float(data.replace(',', ''))
except ValueError: