handle empty strings
This commit is contained in:
parent
11a63713b9
commit
ad60692604
|
@ -77,10 +77,10 @@ class ApartmentFilter(viewsets.ViewSet):
|
||||||
filtered = [];
|
filtered = [];
|
||||||
|
|
||||||
# TODO: Some better converting practice?
|
# TODO: Some better converting practice?
|
||||||
filters['price_range']['from'] = int(filters['price_range']['from']);
|
filters['price_range']['from'] = int('0' if filters['price_range']['from'] == '' else filters['price_range']['from']);
|
||||||
filters['price_range']['to'] = int(filters['price_range']['to']);
|
filters['price_range']['to'] = int('0' if filters['price_range']['to'] == '' else filters['price_range']['to']);
|
||||||
filters['area_range']['from'] = int(filters['area_range']['from']);
|
filters['area_range']['from'] = int('0' if filters['area_range']['from'] == '' else filters['area_range']['from']);
|
||||||
filters['area_range']['to'] = int(filters['area_range']['to']);
|
filters['area_range']['to'] = int('0' if filters['area_range']['to'] == '' else filters['price_range']['to']);
|
||||||
filters['rooms'] = int(filters['rooms'])
|
filters['rooms'] = int(filters['rooms'])
|
||||||
|
|
||||||
for entry in unfiltered:
|
for entry in unfiltered:
|
||||||
|
|
Loading…
Reference in New Issue