fixed clearing amount in recipe edit would result in error
This commit is contained in:
parent
5e2dba7b04
commit
30d766be77
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user