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:
|
if type(data) == int or type(data) == float:
|
||||||
return data
|
return data
|
||||||
elif type(data) == str:
|
elif type(data) == str:
|
||||||
|
if data == '':
|
||||||
|
return 0
|
||||||
try:
|
try:
|
||||||
return float(data.replace(',', ''))
|
return float(data.replace(',', ''))
|
||||||
except ValueError:
|
except ValueError:
|
||||||
|
Loading…
Reference in New Issue
Block a user