[leboncoin] fix bug when user do not choose any city
This commit is contained in:
parent
5741561286
commit
93c5935972
1 changed files with 3 additions and 6 deletions
|
|
@ -52,6 +52,9 @@ class LeboncoinBrowser(PagesBrowser):
|
||||||
|
|
||||||
def search_housings(self, query, advert_type):
|
def search_housings(self, query, advert_type):
|
||||||
type, cities, nb_rooms, area_min, area_max, cost_min, cost_max, ret = self.decode_query(query)
|
type, cities, nb_rooms, area_min, area_max, cost_min, cost_max, ret = self.decode_query(query)
|
||||||
|
if len(cities) == 0 or len(ret) == 0:
|
||||||
|
return list()
|
||||||
|
|
||||||
return self.search.go(region=self.region,
|
return self.search.go(region=self.region,
|
||||||
location=cities,
|
location=cities,
|
||||||
ros=nb_rooms,
|
ros=nb_rooms,
|
||||||
|
|
@ -71,17 +74,11 @@ class LeboncoinBrowser(PagesBrowser):
|
||||||
for c in query.cities:
|
for c in query.cities:
|
||||||
cities.append(c.name)
|
cities.append(c.name)
|
||||||
|
|
||||||
if len(cities) == 0:
|
|
||||||
return list()
|
|
||||||
|
|
||||||
ret = []
|
ret = []
|
||||||
for g in query.house_types:
|
for g in query.house_types:
|
||||||
if g in self.RET:
|
if g in self.RET:
|
||||||
ret.append(self.RET.get(g))
|
ret.append(self.RET.get(g))
|
||||||
|
|
||||||
if len(ret) == 0:
|
|
||||||
return list()
|
|
||||||
|
|
||||||
_type = 'ventes_immobilieres'
|
_type = 'ventes_immobilieres'
|
||||||
if query.type == Query.TYPE_RENT:
|
if query.type == Query.TYPE_RENT:
|
||||||
_type = 'locations'
|
_type = 'locations'
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue