Fix nodes query bind_vars - only add bounds when all coordinates present
All checks were successful
Build Docker Image / build (push) Successful in 1m16s
All checks were successful
Build Docker Image / build (push) Successful in 1m16s
This commit is contained in:
@@ -482,20 +482,24 @@ class Query(graphene.ObjectType):
|
|||||||
LIMIT @offset, @limit
|
LIMIT @offset, @limit
|
||||||
RETURN node
|
RETURN node
|
||||||
"""
|
"""
|
||||||
cursor = db.aql.execute(
|
bind_vars = {
|
||||||
aql,
|
'transport_type': transport_type,
|
||||||
bind_vars={
|
'country': country,
|
||||||
'transport_type': transport_type,
|
'search': search,
|
||||||
'country': country,
|
'offset': 0 if offset is None else offset,
|
||||||
'search': search,
|
'limit': 1000000 if limit is None else limit,
|
||||||
'offset': 0 if offset is None else offset,
|
}
|
||||||
'limit': 1000000 if limit is None else limit,
|
|
||||||
|
# Only add bounds to bind_vars if they are used
|
||||||
|
if west is not None and south is not None and east is not None and north is not None:
|
||||||
|
bind_vars.update({
|
||||||
'west': west,
|
'west': west,
|
||||||
'south': south,
|
'south': south,
|
||||||
'east': east,
|
'east': east,
|
||||||
'north': north,
|
'north': north,
|
||||||
},
|
})
|
||||||
)
|
|
||||||
|
cursor = db.aql.execute(aql, bind_vars=bind_vars)
|
||||||
|
|
||||||
nodes = []
|
nodes = []
|
||||||
for node in cursor:
|
for node in cursor:
|
||||||
|
|||||||
Reference in New Issue
Block a user