Commit 6bc50873 authored by DmitSPopov's avatar DmitSPopov
Browse files

Fix get_recomedation_by_location def

parent f33ae851
......@@ -121,12 +121,14 @@ input_distance_data = {1: [20, 120], 2: [25, -100], 3: [10, 133], 4: [400, 300],
def get_recomendation_by_location(user_id: int, location_str: str):
location = location_str.split()
location = location_str.split(', ')
location[0], location[1] = float(location[0]), float(location[1])
distance_user = {user_id: location}
distance_data = dict()
all_adv = all_advertisments()
for _ in all_adv:
distance_data[_['id']] = _['connect_coordinates']['coordinates']
coords = _['connect_coordinates']['coordinates'].split(', ')
coords[0], coords[1] = float(coords[0]), float(coords[1])
distance_data[_['id']] = coords
return calc_recomendation_by_location(distance_user, distance_data, get_recomendation_by_tags(user_id, all_adv))
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment